-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0596ea6
commit 9ac54e0
Showing
11 changed files
with
98 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"name": "game-of-thrones-e2e", | ||
"name": "got-e2e", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"projectType": "application", | ||
"sourceRoot": "apps/got-e2e/src", | ||
"implicitDependencies": ["game-of-thrones"], | ||
"// targets": "to see all targets run: nx show project game-of-thrones-e2e --web", | ||
"implicitDependencies": ["got"], | ||
"// targets": "to see all targets run: nx show project got-e2e --web", | ||
"targets": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/'); | ||
}); | ||
|
||
test('defualt breadcrumbs for books', async ({ page }) => { | ||
await page.getByText('Books').click(); | ||
|
||
const breadcrumb = page.locator('xng-breadcrumb'); | ||
await expect(breadcrumb).toContainText('books'); | ||
|
||
const breadcrumbList = page.locator('.xng-breadcrumb-list'); | ||
await expect(breadcrumbList).not.toContainText('/'); | ||
}); | ||
|
||
test('breadcrumbs for book with id', async ({ page }) => { | ||
await page.getByText('Books').click(); | ||
|
||
await page.locator('app-books .list-item a').first().click(); | ||
await expect(page.locator('xng-breadcrumb')).toHaveText('books/1'); | ||
|
||
await page.locator('app-book .list-item a').first().click(); | ||
await expect(page.locator('xng-breadcrumb')).toHaveText('books/1/characters/2'); | ||
}); | ||
|
||
test('valid path via breadcrumb navigation', async ({ page }) => { | ||
await page.getByText('Books').click(); | ||
await page.locator('app-books .list-item a').first().click(); | ||
await page.locator('app-book .list-item a').first().click(); | ||
|
||
await page.getByRole('link', { name: 'books/1' }).click(); | ||
await expect(page).toHaveURL('/books/1'); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/'); | ||
}); | ||
|
||
test('toggle breadcrumbs visibility with ngIf', async ({ page }) => { | ||
await expect(page.locator('xng-breadcrumb')).toBeHidden(); | ||
await page.getByRole('button', { name: 'Toggle Breadcrumb Visibility' }).click(); | ||
await expect(page.locator('xng-breadcrumb').first()).toHaveText('Dashboard'); | ||
await page.getByRole('button', { name: 'Toggle Breadcrumb Visibility' }).click(); | ||
await expect(page.locator('xng-breadcrumb')).toBeHidden(); | ||
}); | ||
|
||
test('show breadcrumbs when routeReuseStrategy is false', async ({ page }) => { | ||
await page.getByText('Toggle Breadcrumb Visibility').click(); | ||
await page.getByRole('link', { name: 'Order Details' }).click(); | ||
|
||
const breadcrumbs = page.locator('xng-breadcrumb').first(); | ||
await expect(breadcrumbs).toHaveText('Companies/Company Name/Orders/Order Details'); | ||
}); | ||
|
||
test('show breadcrumbs if dynamically set with autoGenerate false', async ({ page }) => { | ||
await page.getByText('Toggle Breadcrumb Visibility').click(); | ||
await page.getByRole('link', { name: 'Order Items' }).click(); | ||
|
||
const autoGeneratedBreadcrumbs = page.locator('xng-breadcrumb').first(); | ||
await expect(autoGeneratedBreadcrumbs).toContainText('Companies/Company Name/Orders/Order Details/items'); | ||
|
||
const autoGenerationDisabledBreadcrumbs = page.locator('xng-breadcrumb').nth(1); | ||
await expect(autoGenerationDisabledBreadcrumbs).toContainText('Companies/Company Name/Orders/Order Details'); | ||
|
||
await page.getByRole('button', { name: 'Set Order Items Label' }).click(); | ||
await expect(autoGenerationDisabledBreadcrumbs).toContainText('Companies/Company Name/Orders/Order Details/My Order Items'); | ||
}); |
This file was deleted.
Oops, something went wrong.