diff --git a/tests/e2e/specs/drupal/content-hub.spec.ts b/tests/e2e/specs/drupal/content-hub.spec.ts index e6e9a55ad..5098712aa 100644 --- a/tests/e2e/specs/drupal/content-hub.spec.ts +++ b/tests/e2e/specs/drupal/content-hub.spec.ts @@ -5,11 +5,11 @@ import { websiteUrl } from '../../helpers/url'; test.describe('content hub', () => { test.beforeEach(async ({ page }) => { - page.emulateMedia({ reducedMotion: 'reduce' }); + await page.emulateMedia({ reducedMotion: 'reduce' }); }); test('lists pages in alphabetic order', async ({ page }) => { await page.goto(websiteUrl('/en/content-hub')); - const content = await page.getByRole('main'); + const content = page.getByRole('main'); const heading = page.getByRole('heading', { name: 'Architecture', level: 5, @@ -20,7 +20,7 @@ test.describe('content hub', () => { test('allows to switch pages', async ({ page }) => { await page.goto(websiteUrl('/en/content-hub')); - const content = await page.getByRole('main'); + const content = page.getByRole('main'); await expect( content.getByRole('heading', { @@ -46,7 +46,7 @@ test.describe('content hub', () => { test('allows to search for items', async ({ page }) => { await page.goto(websiteUrl('/en/content-hub')); - const content = await page.getByRole('main'); + const content = page.getByRole('main'); await content.getByPlaceholder('Keyword').fill('technologies'); await content.getByRole('button', { name: 'Search' }).click(); await expect( @@ -68,7 +68,7 @@ test.describe('content hub', () => { await page.goto(websiteUrl('/en/content-hub')); // Change language to German. await quickActions.changeLanguageTo(SiteLanguage.Deutsch); - const content = await page.getByRole('main'); + const content = page.getByRole('main'); await expect( content.getByRole('heading', { name: 'Architektur', diff --git a/tests/e2e/specs/drupal/entity-usage.spec.ts b/tests/e2e/specs/drupal/entity-usage.spec.ts index 118ac4421..1a6378571 100644 --- a/tests/e2e/specs/drupal/entity-usage.spec.ts +++ b/tests/e2e/specs/drupal/entity-usage.spec.ts @@ -7,8 +7,11 @@ test.describe('entity-usage', () => { test('media usage works with inline doc links', async ({ page }) => { await page.goto(cmsUrl('/admin/content/media')); - page.locator('div.view-content').getByText('Example DOCX document').click(); - page.locator('a.tabs__link').getByText('Usage').click(); + await page + .locator('div.view-content') + .getByText('Example DOCX document') + .click(); + await page.locator('a.tabs__link').getByText('Usage').click(); await expect( page.locator('table').getByText('Page with links'), ).toBeVisible(); diff --git a/tests/e2e/specs/drupal/homepage.spec.ts b/tests/e2e/specs/drupal/homepage.spec.ts index b15c3155a..f929fb452 100644 --- a/tests/e2e/specs/drupal/homepage.spec.ts +++ b/tests/e2e/specs/drupal/homepage.spec.ts @@ -6,7 +6,7 @@ import { websiteUrl } from '../../helpers/url'; test.describe('the homepage', () => { test('exists in english', async ({ page }) => { await page.goto(websiteUrl('/en')); - const content = await page.getByRole('main'); + const content = page.getByRole('main'); await expect( content.getByRole('heading', { name: 'Architecture' }), ).toBeVisible(); @@ -15,7 +15,7 @@ test.describe('the homepage', () => { test('exists in german', async ({ page }) => { const quickActions = new QuickActions(page); await page.goto(websiteUrl('/en')); - const content = await page.getByRole('main'); + const content = page.getByRole('main'); await quickActions.changeLanguageTo(SiteLanguage.Deutsch); await expect( content.getByRole('heading', { name: 'Architektur' }), @@ -24,12 +24,12 @@ test.describe('the homepage', () => { test('redirects to root path on direct access', async ({ page }) => { await page.goto(websiteUrl('/en/architecture')); - await expect(page.url()).toBe(websiteUrl('/en')); + expect(page.url()).toBe(websiteUrl('/en')); }); test('it redirects to english by default', async ({ page }) => { await page.goto(websiteUrl('/')); - const content = await page.getByRole('main'); + const content = page.getByRole('main'); await expect( content.getByRole('heading', { name: 'Architecture' }), ).toBeVisible(); @@ -41,7 +41,7 @@ test.describe('the homepage', () => { const context = await browser.newContext({ locale: 'de-DE' }); const page = await context.newPage(); await page.goto(websiteUrl('/')); - const content = await page.getByRole('main'); + const content = page.getByRole('main'); await expect( content.getByText('Architektur', { exact: true }), ).toBeVisible(); diff --git a/tests/e2e/specs/drupal/inquiry.spec.ts b/tests/e2e/specs/drupal/inquiry.spec.ts index 828db25f9..f5323ebdc 100644 --- a/tests/e2e/specs/drupal/inquiry.spec.ts +++ b/tests/e2e/specs/drupal/inquiry.spec.ts @@ -22,7 +22,7 @@ test.describe('inquiry (mutation example)', () => { test('invalid e-mail address', async ({ page }) => { await page.goto(websiteUrl('/en/inquiry')); - const content = await page.getByRole('main'); + const content = page.getByRole('main'); await content.getByPlaceholder('Name').fill('John Doe'); await content.getByPlaceholder('Email').fill('john'); await content.getByPlaceholder('Subject').fill('Lorem ipsum'); diff --git a/tests/e2e/specs/drupal/notfound.spec.ts b/tests/e2e/specs/drupal/notfound.spec.ts index 10f7c4cc2..7de96d7ca 100644 --- a/tests/e2e/specs/drupal/notfound.spec.ts +++ b/tests/e2e/specs/drupal/notfound.spec.ts @@ -5,14 +5,14 @@ import { websiteUrl } from '../../helpers/url'; test.describe('not found pages', () => { test('are english by default', async ({ page }) => { await page.goto(websiteUrl('/i-dont-exist')); - const content = await page.getByRole('main'); + const content = page.getByRole('main'); await expect( content.getByText('The requested page is currently in the bathroom.'), ).toBeVisible(); }); test('are german if the prefix is there', async ({ page }) => { await page.goto(websiteUrl('/de/i-dont-exist')); - const content = await page.getByRole('main'); + const content = page.getByRole('main'); await expect( content.getByText('Die Seite die sie gerne hätten is grade nicht da.'), ).toBeVisible(); diff --git a/tests/e2e/specs/drupal/preview-editor-sidebar.spec.ts b/tests/e2e/specs/drupal/preview-editor-sidebar.spec.ts index 2bbeeb44e..300b785e8 100644 --- a/tests/e2e/specs/drupal/preview-editor-sidebar.spec.ts +++ b/tests/e2e/specs/drupal/preview-editor-sidebar.spec.ts @@ -7,7 +7,8 @@ test.describe('instant preview - toggle editor sidebar', () => { test('toggle the preview editor sidebar', async ({ page }) => { await page.goto(cmsUrl('/admin/content')); await page.getByRole('link', { name: 'Add content' }).click(); - await (await page.locator('.layout-region--node-main')) + await page + .locator('.layout-region--node-main') .getByLabel('Title', { exact: true }) .fill('Instant preview sidebar test'); await page.locator('#edit-submit').click(); diff --git a/tests/e2e/specs/drupal/preview.spec.ts b/tests/e2e/specs/drupal/preview.spec.ts index 8d7ae0d39..21d37d4c7 100644 --- a/tests/e2e/specs/drupal/preview.spec.ts +++ b/tests/e2e/specs/drupal/preview.spec.ts @@ -7,7 +7,8 @@ test.describe('instant preview', () => { test('display an unpublished page in an iframe', async ({ page }) => { await page.goto(cmsUrl('/admin/content')); await page.getByRole('link', { name: 'Add content' }).click(); - await (await page.locator('.layout-region--node-main')) + await page + .locator('.layout-region--node-main') .getByLabel('Title', { exact: true }) .fill('Instant preview test'); await page.locator('#edit-submit').click(); diff --git a/tests/e2e/specs/drupal/redirects.spec.ts b/tests/e2e/specs/drupal/redirects.spec.ts index c553b8bbf..13eec233e 100644 --- a/tests/e2e/specs/drupal/redirects.spec.ts +++ b/tests/e2e/specs/drupal/redirects.spec.ts @@ -5,7 +5,7 @@ import { websiteUrl } from '../../helpers/url'; test.describe('drupal redirects', () => { test('are detected', async ({ page }) => { const response = await page.goto(websiteUrl('/node/1')); - await expect(response?.status()).toBe(200); - await expect(page.url).not.toBe(websiteUrl('/node/1')); + expect(response?.status()).toBe(200); + expect(page.url).not.toBe(websiteUrl('/node/1')); }); });