Skip to content

Commit

Permalink
fix old tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dzonidoo committed Apr 16, 2024
1 parent abfe9b7 commit ed92241
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
6 changes: 5 additions & 1 deletion e2e/client/playwright/desks.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import {test, expect} from '@playwright/test';
import {restoreDatabaseSnapshot, s} from './utils';
import {Monitoring} from './page-object-models/monitoring';

/**
* when a desk is mentioned in article comments,
* a notification must show up next to an incoming stage of that desk
*/
test('desk notifications', async ({page}) => {
await restoreDatabaseSnapshot();
const monitoring = new Monitoring(page);

await restoreDatabaseSnapshot();
await page.goto('/#/workspace/monitoring');

await monitoring.selectDeskOrWorkspace('Sports');

await page.locator(
s('monitoring-group=Sports / Working Stage', 'article-item=test sports story'),
).dblclick();
Expand Down
5 changes: 3 additions & 2 deletions e2e/client/playwright/monitoring.duplication.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ test('duplicate in place action', async ({page}) => {
const articleSelector = s('monitoring-group=Sports / Working Stage', 'article-item=test sports story');

await restoreDatabaseSnapshot();

await page.goto('/#/workspace/monitoring');

await monitoring.selectDeskOrWorkspace('Sports');

await expect(page.locator(articleSelector)).toHaveCount(1);

const initialItemsCountAcrossAllStages = await page.locator(s('article-item')).count();
Expand All @@ -29,7 +30,6 @@ test('duplicate to personal space action', async ({page}) => {
const articleSelector = s('monitoring-group=Sports / Working Stage', 'article-item=test sports story');

await restoreDatabaseSnapshot();

await page.goto('/#/workspace/personal');

await expect(page.locator(s('list-item-placeholder'))).toBeVisible();
Expand All @@ -38,6 +38,7 @@ test('duplicate to personal space action', async ({page}) => {
const itemCountInPersonalSpace = await page.locator(s('article-item')).count();

await page.goto('/#/workspace/monitoring');
await monitoring.selectDeskOrWorkspace('Sports');

await monitoring.executeActionOnMonitoringItem(
page.locator(articleSelector),
Expand Down
3 changes: 3 additions & 0 deletions e2e/client/playwright/monitoring.personal-space.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ test('sending an item from personal space', async ({page}) => {
page.locator(s('article-item=personal space article 1')),
'Send to',
);
await page.locator(s('interactive-actions-panel', 'open-popover')).click();
await page.locator(s('tree-select-popover')).getByRole('button', {name: 'Sports'}).click();
await page.locator(s('interactive-actions-panel')).locator(s('item'), {hasText: 'Working Stage'}).check();
await page.locator(s('interactive-actions-panel', 'send')).click();

Expand All @@ -70,5 +72,6 @@ test('sending an item from personal space', async ({page}) => {

// go to monitoring and check visibility of article
await page.goto('/#/workspace/monitoring');
await monitoring.selectDeskOrWorkspace('Sports');
await expect(page.locator(s('monitoring-view', 'monitoring-group=Sports / Working Stage'))).toBeVisible();
});
5 changes: 4 additions & 1 deletion e2e/client/playwright/page-object-models/monitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ export class Monitoring {
async createArticleFromTemplate(template: string, options?: {slugline?: string}): Promise<void> {
await this.page.locator(s('content-create')).click();
await this.page.locator(s('content-create-dropdown')).getByRole('button', {name: 'More Templates...'}).click();
await this.page.locator(s('content-create-dropdown')).getByRole('button', {name: template}).click();
await this.page
.locator(s('content-create-dropdown'))
.getByRole('button', {name: template, exact: true})
.click();

if (options != null) {
let keys = Object.keys(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class DropdownOption extends React.PureComponent<IProps> {
className="content-create-dropdown--option"
onClick={onClick}
data-test-id={this.props['data-test-id']}
aria-label={label}
>
{
icon != null && (
Expand Down

0 comments on commit ed92241

Please sign in to comment.