Skip to content

Commit 46d7cfa

Browse files
committed
added e2e screenshots
Signed-off-by: Andrew Twydell <[email protected]>
1 parent 2eae393 commit 46d7cfa

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ jobs:
116116
if: ${{ always() && steps.build.outcome == 'success' }}
117117
run: |
118118
cd packages/vsce/
119-
npm run test:e2e:setup
120-
CI=true npx playwright test -c __tests__/__e2e__/playwright.config.ts --workers=1
119+
npm run test:e2e
121120
122121
- name: Save wiremock logs
123122
if: success() || failure()

packages/vsce/__tests__/__e2e__/specs/commands.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ test.afterEach(async ({ page }) => {
2323

2424
test.describe("Command tests", () => {
2525
test("should copy user agent header", async ({ page }) => {
26+
await page.screenshot({ fullPage: true, path: "./__tests__/screenshots/user-agent/test-start.png" });
2627
await runInCommandPalette(page, "Copy User Agent header");
28+
await page.screenshot({ fullPage: true, path: "./__tests__/screenshots/user-agent/command-run-in-palette.png" });
2729
await expect(page.getByText("Copied User-Agent header to clipboard", { exact: true })).toBeVisible();
30+
await page.screenshot({ fullPage: true, path: "./__tests__/screenshots/user-agent/expected-popup.png" });
2831

2932
const clipboardHeader = await getClipboardContent(page);
3033
expect(clipboardHeader).toContain("zowe.cics-extension-for-zowe/3.");

packages/vsce/__tests__/__e2e__/utils/helpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,13 @@ export const runInCommandPalette = async (page: Page, command: string) => {
9999
await page.keyboard.up("Shift");
100100
await page.keyboard.up("Control");
101101

102+
await page.screenshot({ fullPage: true, path: "./__tests__/screenshots/user-agent/opened-command-palette.png" });
102103
await expect(page.getByRole("textbox").first()).toHaveValue(">");
104+
await page.screenshot({ fullPage: true, path: "./__tests__/screenshots/user-agent/expected-greater-than.png" });
103105
await page.getByRole("textbox").fill(`>${command}`);
106+
await page.screenshot({ fullPage: true, path: "./__tests__/screenshots/user-agent/filled-in-command.png" });
104107
await page.keyboard.press("Enter");
108+
await page.screenshot({ fullPage: true, path: "./__tests__/screenshots/user-agent/enter-pressed.png" });
105109
};
106110

107111
export const getClipboardContent = async (page: Page) => {

0 commit comments

Comments
 (0)