Skip to content

Commit

Permalink
Better expected text
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Tideman committed Jan 16, 2024
1 parent 13bea26 commit 83a04b9
Showing 1 changed file with 9 additions and 63 deletions.
72 changes: 9 additions & 63 deletions tests/e2e/workflows.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, Locator, test } from '@playwright/test';
import { expect, test } from '@playwright/test';

test.beforeEach(async ({ page, baseURL }) => {
await page.goto(baseURL);
Expand All @@ -11,65 +11,15 @@ test.describe('Workflows list', () => {
.getByRole('link', { name: 'e2e-workflow-1' })
.click({ force: true });

Check warning on line 12 in tests/e2e/workflows.spec.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected use of { force: true } option

let codeBlock: Locator;
let toggle: Locator;

codeBlock = page.getByTestId('input-and-results');

toggle = codeBlock.getByRole('heading', { name: 'Input and Results' });
const codeBlock = page.getByTestId('input-and-results');
const toggle = codeBlock.getByRole('heading', {
name: 'Input and Results',
});
await toggle.click();
const input = page.getByTestId('workflow-input');
await expect(input).toContainText(
'Input ›"Plain text input 1" Click to copy content',
);
await toggle.click();

codeBlock = page.locator('.expanded-cell >> .cm-editor');

toggle = page.getByRole('cell', { name: 'WorkflowExecutionStarted' });
await toggle.click();
await expect(
codeBlock
.getByText('Input ›"Plain text input 1" Click to copy content')
.first(),
).toBeVisible();
await toggle.click();

toggle = page.getByRole('cell', { name: 'MarkerRecorded' }).first();
await toggle.click();
await expect(
codeBlock
.getByText('Input ›"Plain text input 1" Click to copy content')
.first(),
).toBeVisible();
await toggle.click();

toggle = page.getByRole('cell', { name: 'ActivityTaskScheduled' }).first();
await toggle.click();
await expect(
codeBlock
.getByText('Input ›"Plain text input 1" Click to copy content')
.first(),
).toBeVisible();
await toggle.click();

toggle = page.getByRole('cell', { name: 'ActivityTaskCompleted' }).first();
await toggle.click();
await expect(
codeBlock
.getByText('Input ›"Plain text input 1" Click to copy content')
.first(),
).toBeVisible();
await toggle.click();

toggle = page.getByRole('cell', { name: 'WorkflowExecutionCompleted' });
await toggle.click();
await expect(
codeBlock
.getByText('Input ›"Plain text input 1" Click to copy content')
.first(),
).toBeVisible();
await toggle.click();
});

test('should render decoded call stack', async ({ page }) => {
Expand All @@ -82,10 +32,8 @@ test.describe('Workflows list', () => {
const tab = page.getByTestId('call-stack-tab');
await tab.click();

const codeBlock = page.locator('.readOnly .cm-editor');
await expect(codeBlock).toContainText(
'Input ›"Plain text input 1" Click to copy content',
);
const codeBlock = page.getByRole('textbox');
await expect(codeBlock).toContainText('at workflow');
});

test('should render decoded query results', async ({ page }) => {
Expand All @@ -98,9 +46,7 @@ test.describe('Workflows list', () => {

await page.getByLabel('Query Type').selectOption('is-blocked');

const codeBlock = page.locator('.readOnly .cm-editor');
await expect(codeBlock).toContainText(
'Input ›"Plain text input 1" Click to copy content',
);
const codeBlock = page.getByRole('textbox');
await expect(codeBlock).toContainText('true');
});
});

0 comments on commit 83a04b9

Please sign in to comment.