Skip to content

Commit

Permalink
fix(docs-e2e): address pipeline workflow with specifc layout projects…
Browse files Browse the repository at this point in the history
… and allowed flaky tests retries
  • Loading branch information
JeremyFriesenGitHub committed Sep 6, 2024
1 parent a8f26b1 commit 0bde55c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/docs-e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const baseURL = process.env.BASE_URL || 'http://127.0.0.1:3000'
export default defineConfig({
...nxE2EPreset(__filename, { testDir: './src' }),
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
retries: 2,
use: {
baseURL,
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
Expand Down
45 changes: 45 additions & 0 deletions apps/docs-e2e/src/docs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ test.describe(`Common MOBILE, TABLET and DESKTOP Layout Elements`, {
test.describe(`Common MOBILE and TABLET Layout Elements`, {
tag: '@smoke',
}, () => {
test.beforeEach(async () => {
const device = test.info().project.name
if (device.includes('desktop')) {
test.skip()
}
})

test(`should have quick links section visible in mobile/tablet header`, async ({ docsLayoutPage }) => {
await expect(docsLayoutPage.quickLinks).toBeVisible()
})
Expand Down Expand Up @@ -88,6 +95,9 @@ test.describe(`Common MOBILE and TABLET Menu Elements`, {
else if (device.includes('tablet')) {
await docsLayoutPage.kebabIcon.click()
}
else {
test.skip()
}
})

test(`should have docs pages section dropdown menu visible for mobile/tablet`, async ({ docsLayoutPage }) => {
Expand Down Expand Up @@ -162,6 +172,13 @@ test.describe(`Common MOBILE and TABLET Menu Elements`, {
test.describe('Common TABLET and DESKTOP Layout Elements', {
tag: '@smoke',
}, () => {
test.beforeEach(async () => {
const device = test.info().project.name
if (device.includes('mobile')) {
test.skip()
}
})

test(`should contain search bar in tablet/desktop header`, async ({ docsLayoutPage }) => {
await expect(docsLayoutPage.searchBar).toBeVisible()
})
Expand All @@ -184,6 +201,13 @@ test.describe('Common TABLET and DESKTOP Layout Elements', {
test.describe('Unique DESKTOP Header Elements', {
tag: '@smoke',
}, () => {
test.beforeEach(async () => {
const device = test.info().project.name
if (device.includes('mobile') || device.includes('tablet')) {
test.skip()
}
})

test('should contain Website dropdown button in desktop header', async ({ docsLayoutPage }) => {
await expect(docsLayoutPage.websiteDropdownButton).toBeVisible()
})
Expand Down Expand Up @@ -250,6 +274,13 @@ test.describe('Unique DESKTOP Header Elements', {
test.describe('Unique Floating Table of Contents DESKTOP Elements', {
tag: '@smoke',
}, () => {
test.beforeEach(async () => {
const device = test.info().project.name
if (device.includes('mobile') || device.includes('tablet')) {
test.skip()
}
})

test('should contain \'Edit on GitHub\' button in floating table of contents', async ({ docsLayoutPage }) => {
await expect(docsLayoutPage.editOnGitHubButton).toBeVisible()
})
Expand All @@ -263,6 +294,13 @@ test.describe('Unique Floating Table of Contents DESKTOP Elements', {
test.describe('Unique MOBILE Header Elements', {
tag: '@smoke',
}, () => {
test.beforeEach(async () => {
const device = test.info().project.name
if (device.includes('desktop') || device.includes('tablet')) {
test.skip()
}
})

test('should contain hamburger icon', async ({ docsLayoutPage }) => {
await expect(docsLayoutPage.hamburgerIcon).toBeVisible()
})
Expand All @@ -281,6 +319,13 @@ test.describe('Unique MOBILE Header Elements', {
test.describe('Unique TABLET Header Elements', {
tag: '@smoke',
}, () => {
test.beforeEach(async () => {
const device = test.info().project.name
if (device.includes('desktop') || device.includes('mobile')) {
test.skip()
}
})

test('should have kebab icon visible', async ({ docsLayoutPage }) => {
await expect(docsLayoutPage.kebabIcon).toBeVisible()
})
Expand Down

0 comments on commit 0bde55c

Please sign in to comment.