-
Notifications
You must be signed in to change notification settings - Fork 4
Playwright screenshots #279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
dc02c84
Tests green
krystian-panek-vmltech c7a8ef5
Attached screenshots
krystian-panek-vmltech 6297317
Fix
krystian-panek-vmltech caceb87
Clean up
krystian-panek-vmltech 6ce3f15
Update test/e2e/004-automatic-scripts.spec.ts
krystian-panek-vmltech File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,24 +1,44 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
| import { expectCodeExecutorStatus, expectHealthyStatus } from './utils/expect'; | ||
| import { testOnEnv, apiHeaders } from './utils/env'; | ||
| import { attachScreenshot } from './utils/page'; | ||
|
|
||
| test.describe('General', () => { | ||
| test('Tool is accessible', async ({ page }) => { | ||
| test('Tool is accessible', async ({ page }, testInfo) => { | ||
| await page.goto('/acm'); | ||
|
|
||
| const title = page.locator('.granite-title', { hasText: 'Content Manager' }); | ||
| await expect(title).toBeVisible(); | ||
|
|
||
| await attachScreenshot(page, testInfo, 'Dashboard Page'); | ||
| }); | ||
|
|
||
| testOnEnv('local')('Tool state is reset', async ({ page }) => { | ||
| const clearResponse = await page.request.post('/apps/acm/api/event.json?name=HISTORY_CLEAR', { headers: await apiHeaders(page) }); | ||
| expect(clearResponse.ok()).toBeTruthy(); | ||
| const clearJson = await clearResponse.json(); | ||
| expect(clearJson).toEqual({ status: 200, message: "Event 'HISTORY_CLEAR' dispatched successfully!", data: null }); | ||
| await page.waitForTimeout(3000); | ||
|
|
||
| const bootResponse = await page.request.post('/apps/acm/api/event.json?name=SCRIPT_SCHEDULER_BOOT', { headers: await apiHeaders(page) }); | ||
| expect(bootResponse.ok()).toBeTruthy(); | ||
| const bootJson = await bootResponse.json(); | ||
| expect(bootJson).toEqual({ status: 200, message: "Event 'SCRIPT_SCHEDULER_BOOT' dispatched successfully!", data: null }); | ||
| await page.waitForTimeout(10000); | ||
| }); | ||
|
|
||
| test('System is healthy', async ({ page }) => { | ||
| test('System is healthy', async ({ page }, testInfo) => { | ||
| await page.goto('/acm#/maintenance?tab=health-checker'); | ||
|
|
||
| await expectHealthyStatus(page); | ||
| await attachScreenshot(page, testInfo, 'Health Checker'); | ||
| }); | ||
|
|
||
| test('Code executor is idle', async ({ page }) => { | ||
| test('Code executor is idle', async ({ page }, testInfo) => { | ||
| await page.goto('/acm#/maintenance?tab=code-executor'); | ||
|
|
||
| await expectCodeExecutorStatus(page); | ||
| await attachScreenshot(page, testInfo, 'Code Executor'); | ||
| }); | ||
|
|
||
| }); |
This file contains hidden or 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 hidden or 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 hidden or 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,24 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
| import { attachScreenshot } from './utils/page'; | ||
|
|
||
| test.describe('Automatic Scripts', () => { | ||
|
|
||
| test('Executions saved in history', async ({ page }, testInfo) => { | ||
| await page.goto('/acm'); | ||
| await page.getByRole('button', { name: 'History' }).click(); | ||
|
|
||
| const grid = page.locator('[role="grid"][aria-label="Executions table"]'); | ||
| await expect(grid).toBeVisible(); | ||
| const rows = grid.locator('[role="row"]'); | ||
|
|
||
| await page.getByRole('searchbox', { name: 'Executable' }).fill('example/ACME-20_once'); | ||
| await expect(rows.nth(1)).toContainText('Script \'example/ACME-20_once\''); | ||
| await expect(rows.nth(1)).toContainText('succeeded'); | ||
| await attachScreenshot(page, testInfo, `Script List filtered by 'ACME-20_once'`); | ||
|
|
||
| await page.getByRole('searchbox', { name: 'Executable' }).fill('example/ACME-21_changed'); | ||
| await expect(rows.nth(1)).toContainText('Script \'example/ACME-21_changed\''); | ||
| await expect(rows.nth(1)).toContainText('succeeded'); | ||
| await attachScreenshot(page, testInfo, `Script List filtered by 'ACME-21_changed'`); | ||
| }); | ||
| }); |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.