From e11843d69e6b0c6af60704b75fe4e42a9a034c0e Mon Sep 17 00:00:00 2001 From: niraj Date: Tue, 14 May 2024 08:23:21 +0545 Subject: [PATCH 1/2] Enhance allure dashboard visibility --- .../workflows/test_integration_playwright.yml | 15 +++++++++-- tests/govtool-frontend/playwright/.gitignore | 3 +-- .../playwright/lib/helpers/allure.ts | 18 +++++++++++++ .../lib/pages/dRepRegistrationPage.ts | 27 +++++-------------- .../playwright/playwright.config.ts | 9 ++++++- .../walletConnect.loggedin.spec.ts | 8 +++--- .../1-wallet-connect/walletConnect.spec.ts | 13 +++++---- .../2-delegation/delegation.drep.spec.ts | 5 ++++ .../2-delegation/delegation.loggedin.spec.ts | 6 ++++- .../tests/2-delegation/delegation.spec.ts | 5 ++++ ...delegationFunctionality.delegation.spec.ts | 5 ++++ .../dRepRegistration.dRep.spec.ts | 8 +++++- .../dRepRegistration.loggedin.spec.ts | 5 ++++ .../dRepRegistration.spec.ts | 5 ++++ .../proposalVisibility.dRep.spec.ts | 17 +++++++----- .../proposalVisibility.loggedin.spec.ts | 5 ++++ .../proposalVisibility.spec.ts | 5 ++++ .../proposalFunctionality.dRep.spec.ts | 10 +++++-- .../proposalFunctionality.loggedin.spec.ts | 5 ++++ .../miscellaneous.loggedin.spec.ts | 7 ++++- .../6-miscellaneous/miscellaneous.spec.ts | 10 ++++--- .../playwright/tests/auth.setup.ts | 6 +++++ .../playwright/tests/delegation.teardown.ts | 6 ++++- .../playwright/tests/faucet.setup.ts | 6 +++++ .../playwright/tests/wallet.bootstrap.ts | 7 +++++ 25 files changed, 166 insertions(+), 50 deletions(-) create mode 100644 tests/govtool-frontend/playwright/lib/helpers/allure.ts diff --git a/.github/workflows/test_integration_playwright.yml b/.github/workflows/test_integration_playwright.yml index 80f0cb971..d0a9cd365 100644 --- a/.github/workflows/test_integration_playwright.yml +++ b/.github/workflows/test_integration_playwright.yml @@ -2,8 +2,19 @@ name: Integration Test [Playwright] on: push: - paths: - - .github/workflows/test_integration_playwright.yml + branches: + - enhancement/allure-report + workflow_dispatch: + inputs: + logLevel: + description: "Log level" + required: true + default: "warning" + type: choice + options: + - info + - warning + - debug workflow_run: workflows: ["Build and deploy GovTool test stack"] types: [completed] diff --git a/tests/govtool-frontend/playwright/.gitignore b/tests/govtool-frontend/playwright/.gitignore index 0a969ff71..7ae7583b0 100644 --- a/tests/govtool-frontend/playwright/.gitignore +++ b/tests/govtool-frontend/playwright/.gitignore @@ -12,5 +12,4 @@ allure-results/ allure-report/ .secrets .vars -.lock-pool/ -.logs/ +lock_logs.txt diff --git a/tests/govtool-frontend/playwright/lib/helpers/allure.ts b/tests/govtool-frontend/playwright/lib/helpers/allure.ts new file mode 100644 index 000000000..ec3f5823c --- /dev/null +++ b/tests/govtool-frontend/playwright/lib/helpers/allure.ts @@ -0,0 +1,18 @@ +import { allure } from "allure-playwright"; +import { isMobile } from "./mobile"; +import { chromium } from "@playwright/test"; + +export const setAllureEpic = async (groupName: string) => { + const browser = await chromium.launch(); + const page = await browser.newPage(); + if (isMobile(page)) { + await allure.epic("6. Miscellaneous"); + await allure.story("6A. Should be accessible from mobile"); + } else { + await allure.epic(groupName); + } +}; + +export const setAllureStory = async (groupName: string) => { + await allure.story(groupName); +}; diff --git a/tests/govtool-frontend/playwright/lib/pages/dRepRegistrationPage.ts b/tests/govtool-frontend/playwright/lib/pages/dRepRegistrationPage.ts index 8eee69979..a8920d583 100644 --- a/tests/govtool-frontend/playwright/lib/pages/dRepRegistrationPage.ts +++ b/tests/govtool-frontend/playwright/lib/pages/dRepRegistrationPage.ts @@ -83,21 +83,12 @@ export default class DRepRegistrationPage { await this.linkInput.fill(link); for (const err of formErrors.dRepName) { - await expect( - this.page.getByTestId(err), - `Invalid name: ${name}` - ).toBeHidden(); + await expect(this.page.getByTestId(err)).toBeHidden(); } - await expect( - this.page.getByTestId(formErrors.email), - `Invalid email: ${email}` - ).toBeHidden(); + await expect(this.page.getByTestId(formErrors.email)).toBeHidden(); - expect( - await this.bioInput.textContent(), - "Bio exceeded 500 characters" - ).toEqual(bio); + expect(await this.bioInput.textContent()).toEqual(bio); await expect(this.page.getByTestId(formErrors.link)).toBeHidden(); @@ -127,17 +118,11 @@ export default class DRepRegistrationPage { }) .all(); - expect(nameErrors.length, `Valid name: ${name}`).toEqual(1); + expect(nameErrors.length).toEqual(1); - await expect( - this.page.getByTestId(formErrors.email), - `Valid email: ${email}` - ).toBeVisible(); + await expect(this.page.getByTestId(formErrors.email)).toBeVisible(); - expect( - await this.bioInput.textContent(), - "Bio less than 500 characters" - ).not.toEqual(bio); + expect(await this.bioInput.textContent()).not.toEqual(bio); await expect(this.page.getByTestId(formErrors.link)).toBeVisible(); diff --git a/tests/govtool-frontend/playwright/playwright.config.ts b/tests/govtool-frontend/playwright/playwright.config.ts index 092717ac8..8f476bd83 100644 --- a/tests/govtool-frontend/playwright/playwright.config.ts +++ b/tests/govtool-frontend/playwright/playwright.config.ts @@ -27,7 +27,14 @@ export default defineConfig({ /*use Allure Playwright's testPlanFilter() to determine the grep parameter*/ grep: testPlanFilter(), /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: process.env.CI ? [["line"], ["allure-playwright"]] : [["line"]], + reporter: process.env.CI + ? [ + ["line"], + [ + "allure-playwright" + ], + ] + : [["line"]], /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ diff --git a/tests/govtool-frontend/playwright/tests/1-wallet-connect/walletConnect.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/1-wallet-connect/walletConnect.loggedin.spec.ts index ab080382a..b1a23c363 100644 --- a/tests/govtool-frontend/playwright/tests/1-wallet-connect/walletConnect.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/1-wallet-connect/walletConnect.loggedin.spec.ts @@ -1,12 +1,14 @@ import { user01Wallet } from "@constants/staticWallets"; import { test } from "@fixtures/walletExtension"; +import { setAllureEpic } from "@helpers/allure"; import LoginPage from "@pages/loginPage"; test.use({ storageState: ".auth/user01.json", wallet: user01Wallet }); +test.beforeEach(async () => { + await setAllureEpic("1. Wallet connect"); +}); -test("1B: Should connect wallet with single stake key @smoke @fast", async ({ - page, -}) => { +test("1B: Should connect wallet with single stake key", async ({ page }) => { const loginPage = new LoginPage(page); await loginPage.goto(); await loginPage.isLoggedIn(); diff --git a/tests/govtool-frontend/playwright/tests/1-wallet-connect/walletConnect.spec.ts b/tests/govtool-frontend/playwright/tests/1-wallet-connect/walletConnect.spec.ts index 04daf9241..f23e5947e 100644 --- a/tests/govtool-frontend/playwright/tests/1-wallet-connect/walletConnect.spec.ts +++ b/tests/govtool-frontend/playwright/tests/1-wallet-connect/walletConnect.spec.ts @@ -1,11 +1,16 @@ import createWallet from "@fixtures/createWallet"; import { test } from "@fixtures/walletExtension"; +import { setAllureEpic } from "@helpers/allure"; import convertBufferToHex from "@helpers/convertBufferToHex"; import { ShelleyWallet } from "@helpers/crypto"; import LoginPage from "@pages/loginPage"; import { expect } from "@playwright/test"; -test("1A. Should connect wallet and choose stake-key to use @smoke @fast", async ({ +test.beforeEach(async () => { + await setAllureEpic("1. Wallet connect"); +}); + +test("1A. Should connect wallet and choose stake-key to use", async ({ page, }) => { const shellyWallet = await ShelleyWallet.generate(); @@ -23,9 +28,7 @@ test("1A. Should connect wallet and choose stake-key to use @smoke @fast", async await loginPage.login(); }); -test("1C: Should disconnect Wallet When connected @smoke @fast", async ({ - page, -}) => { +test("1C: Should disconnect Wallet When connected", async ({ page }) => { await createWallet(page); const loginPage = new LoginPage(page); @@ -34,7 +37,7 @@ test("1C: Should disconnect Wallet When connected @smoke @fast", async ({ await loginPage.logout(); }); -test("1D. Should check correct network (Testnet/Mainnet) on connection @smoke @fast", async ({ +test("1D. Should check correct network (Testnet/Mainnet) on connection", async ({ page, }) => { const wrongNetworkId = 1; // mainnet network diff --git a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts index 74b21fe22..a37e9ee5d 100644 --- a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts @@ -3,6 +3,7 @@ import { dRep01Wallet } from "@constants/staticWallets"; import { createTempDRepAuth } from "@datafactory/createAuth"; import { faker } from "@faker-js/faker"; import { test } from "@fixtures/walletExtension"; +import { setAllureEpic } from "@helpers/allure"; import { ShelleyWallet } from "@helpers/crypto"; import { isMobile, openDrawer } from "@helpers/mobile"; import { createNewPageWithWallet } from "@helpers/page"; @@ -12,6 +13,10 @@ import DRepDirectoryPage from "@pages/dRepDirectoryPage"; import DRepRegistrationPage from "@pages/dRepRegistrationPage"; import { expect } from "@playwright/test"; +test.beforeEach(async () => { + await setAllureEpic("2. Delegation"); +}); + test("2C. Should open wallet connection popup on delegate in disconnected state", async ({ page, }) => { diff --git a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.loggedin.spec.ts index a76dcd622..c1271c825 100644 --- a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.loggedin.spec.ts @@ -1,5 +1,6 @@ import { dRep01Wallet, user01Wallet } from "@constants/staticWallets"; import { test } from "@fixtures/walletExtension"; +import { setAllureEpic } from "@helpers/allure"; import { ShelleyWallet } from "@helpers/crypto"; import { isMobile } from "@helpers/mobile"; import extractDRepFromWallet from "@helpers/shellyWallet"; @@ -8,11 +9,14 @@ import { expect } from "@playwright/test"; test.use({ storageState: ".auth/user01.json", wallet: user01Wallet }); +test.beforeEach(async () => { + await setAllureEpic("2. Delegation"); +}); + test("2B. Should access DRep Directory page", async ({ page }) => { await page.goto("/"); await page.getByTestId("view-drep-directory-button").click(); - if (isMobile(page)) { await expect(page.getByText("DRep Directory")).toBeVisible(); } else { diff --git a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.spec.ts b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.spec.ts index daa7bade1..17cb4136d 100644 --- a/tests/govtool-frontend/playwright/tests/2-delegation/delegation.spec.ts +++ b/tests/govtool-frontend/playwright/tests/2-delegation/delegation.spec.ts @@ -1,8 +1,13 @@ import { dRep01Wallet } from "@constants/staticWallets"; import DRepDirectoryPage from "@pages/dRepDirectoryPage"; +import { setAllureEpic } from "@helpers/allure"; import { expect, test } from "@playwright/test"; import { DRepStatus } from "@types"; +test.beforeEach(async () => { + await setAllureEpic("2. Delegation"); +}); + test("2J. Should search by DRep id", async ({ page }) => { const dRepDirectory = new DRepDirectoryPage(page); await dRepDirectory.goto(); diff --git a/tests/govtool-frontend/playwright/tests/2-delegation/delegationFunctionality.delegation.spec.ts b/tests/govtool-frontend/playwright/tests/2-delegation/delegationFunctionality.delegation.spec.ts index aea64a817..dc9a069a0 100644 --- a/tests/govtool-frontend/playwright/tests/2-delegation/delegationFunctionality.delegation.spec.ts +++ b/tests/govtool-frontend/playwright/tests/2-delegation/delegationFunctionality.delegation.spec.ts @@ -2,6 +2,7 @@ import environments from "@constants/environments"; import { adaHolder01Wallet, dRep01Wallet } from "@constants/staticWallets"; import { createTempDRepAuth } from "@datafactory/createAuth"; import { test } from "@fixtures/walletExtension"; +import { setAllureEpic } from "@helpers/allure"; import { ShelleyWallet } from "@helpers/crypto"; import { createNewPageWithWallet } from "@helpers/page"; import extractDRepFromWallet from "@helpers/shellyWallet"; @@ -13,6 +14,10 @@ import { import DRepDirectoryPage from "@pages/dRepDirectoryPage"; import { expect } from "@playwright/test"; +test.beforeEach(async () => { + await setAllureEpic("2. Delegation"); +}); + test.describe("Delegate to others", () => { test.describe.configure({ mode: "serial" }); diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts index 8a2a75ee8..515179e7a 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.dRep.spec.ts @@ -3,6 +3,7 @@ import { dRep01Wallet } from "@constants/staticWallets"; import { createTempDRepAuth } from "@datafactory/createAuth"; import { faker } from "@faker-js/faker"; import { test } from "@fixtures/walletExtension"; +import { setAllureEpic } from "@helpers/allure"; import { ShelleyWallet } from "@helpers/crypto"; import { createNewPageWithWallet } from "@helpers/page"; import { @@ -15,6 +16,10 @@ import GovernanceActionsPage from "@pages/governanceActionsPage"; import { expect } from "@playwright/test"; import * as crypto from "crypto"; +test.beforeEach(async () => { + await setAllureEpic("3. DRep registration"); +}); + test.describe("Logged in DReps", () => { test.use({ storageState: ".auth/dRep01.json", wallet: dRep01Wallet }); @@ -30,7 +35,8 @@ test.describe("Logged in DReps", () => { test.use({ storageState: ".auth/dRep01.json", wallet: dRep01Wallet }); // Skipped: No option to update metadata - test.skip("3H. Should be able to update metadata", async ({ page }) => { + test("3H. Should be able to update metadata ", async ({ page }) => { + test.skip(); page.getByTestId("change-metadata-button").click(); page.getByTestId("url-input").fill("https://google.com"); page.getByTestId("hash-input").fill(crypto.randomBytes(32).toString("hex")); diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts index f91ca65cf..8d6a74b70 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts @@ -1,6 +1,7 @@ import { user01Wallet } from "@constants/staticWallets"; import { faker } from "@faker-js/faker"; import { test } from "@fixtures/walletExtension"; +import { setAllureEpic } from "@helpers/allure"; import DRepRegistrationPage from "@pages/dRepRegistrationPage"; import { expect } from "@playwright/test"; @@ -9,6 +10,10 @@ test.use({ wallet: user01Wallet, }); +test.beforeEach(async () => { + await setAllureEpic("3. DRep registration"); +}); + test("3B. Should access DRep registration page", async ({ page }) => { await page.goto("/"); diff --git a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.spec.ts b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.spec.ts index 3a8e72b6a..d88415d53 100644 --- a/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.spec.ts +++ b/tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.spec.ts @@ -1,5 +1,10 @@ +import { setAllureEpic } from "@helpers/allure"; import { expect, test } from "@playwright/test"; +test.beforeEach(async () => { + await setAllureEpic("3. DRep registration"); +}); + test("3C. Should open wallet connection popup on DRep registration in disconnected state", async ({ page, }) => { diff --git a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts index a0f5140af..a82e4687d 100644 --- a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.dRep.spec.ts @@ -3,6 +3,7 @@ import { dRep01Wallet } from "@constants/staticWallets"; import { createTempDRepAuth } from "@datafactory/createAuth"; import { faker } from "@faker-js/faker"; import { test } from "@fixtures/walletExtension"; +import { setAllureEpic } from "@helpers/allure"; import { lovelaceToAda } from "@helpers/cardano"; import { ShelleyWallet } from "@helpers/crypto"; import { createNewPageWithWallet } from "@helpers/page"; @@ -17,12 +18,16 @@ import { FilterOption, IProposal } from "@types"; test.describe("Logged in DRep", () => { test.use({ storageState: ".auth/dRep01.json", wallet: dRep01Wallet }); - test("4E. Should display DRep's voting power in governance actions page", async ({ - page, - }) => { - const votingPowerPromise = page.waitForResponse("**/get-voting-power/**"); - const governanceActionsPage = new GovernanceActionsPage(page); - await governanceActionsPage.goto(); +test.beforeEach(async () => { + await setAllureEpic("4. Proposal visibility"); +}); + +test("4E. Should display DRep's voting power in governance actions page", async ({ + page, +}) => { + const votingPowerPromise = page.waitForResponse("**/get-voting-power/**"); + const governanceActionsPage = new GovernanceActionsPage(page); + await governanceActionsPage.goto(); const res = await votingPowerPromise; const votingPower = await res.json(); diff --git a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.loggedin.spec.ts index 646dd688b..4501dab6e 100644 --- a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.loggedin.spec.ts @@ -1,5 +1,6 @@ import { user01Wallet } from "@constants/staticWallets"; import { test } from "@fixtures/walletExtension"; +import { setAllureEpic } from "@helpers/allure"; import extractExpiryDateFromText from "@helpers/extractExpiryDateFromText"; import { isMobile, openDrawer } from "@helpers/mobile"; import removeAllSpaces from "@helpers/removeAllSpaces"; @@ -24,6 +25,10 @@ enum SortOption { test.use({ storageState: ".auth/user01.json", wallet: user01Wallet }); +test.beforeEach(async () => { + await setAllureEpic("4. Proposal visibility"); +}); + test("4A.1: Should access Governance Actions page with connecting wallet", async ({ page, }) => { diff --git a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.spec.ts b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.spec.ts index 5a5cf5f01..cb5c0f2e1 100644 --- a/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.spec.ts +++ b/tests/govtool-frontend/playwright/tests/4-proposal-visibility/proposalVisibility.spec.ts @@ -1,6 +1,11 @@ +import { setAllureEpic } from "@helpers/allure"; import GovernanceActionsPage from "@pages/governanceActionsPage"; import { expect, test } from "@playwright/test"; +test.beforeEach(async () => { + await setAllureEpic("4. Proposal visibility"); +}); + test("4A.2: Should access Governance Actions page without connecting wallet", async ({ page, }) => { diff --git a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts index cf3c7400d..9cd656642 100644 --- a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts +++ b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts @@ -2,6 +2,7 @@ import environments from "@constants/environments"; import { dRep01Wallet } from "@constants/staticWallets"; import { createTempDRepAuth } from "@datafactory/createAuth"; import { test } from "@fixtures/walletExtension"; +import { setAllureEpic } from "@helpers/allure"; import { ShelleyWallet } from "@helpers/crypto"; import { createNewPageWithWallet } from "@helpers/page"; import { @@ -14,6 +15,10 @@ import GovernanceActionsPage from "@pages/governanceActionsPage"; import { expect } from "@playwright/test"; import kuberService from "@services/kuberService"; +test.beforeEach(async () => { + await setAllureEpic("5. Proposal functionality"); +}); + test.describe("Proposal checks", () => { test.use({ storageState: ".auth/dRep01.json", wallet: dRep01Wallet }); @@ -60,7 +65,8 @@ test.describe("Proposal checks", () => { }); // Skipped: No url/hash input to validate - test.skip("5D. Should validate proposal voting", async () => { + test("5D. Should validate proposal voting", async () => { + test.skip(); // const invalidURLs = ["testdotcom", "https://testdotcom", "https://test.c"]; // invalidURLs.forEach(async (url) => { // govActionDetailsPage.urlInput.fill(url); @@ -198,7 +204,7 @@ test.describe("Check voting power", () => { await dRepPage.goto("/"); await dRepPage.getByTestId("retire-button").click(); - await dRepPage.getByTestId("continue-retirement-button").click(); + await dRepPage.getByTestId("continue-retirement-button").click(); await expect( dRepPage.getByTestId("retirement-transaction-submitted-modal") ).toBeVisible(); diff --git a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.loggedin.spec.ts index 17034e23e..5c5cae3b6 100644 --- a/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.loggedin.spec.ts @@ -1,9 +1,14 @@ import { user01Wallet } from "@constants/staticWallets"; import { test } from "@fixtures/walletExtension"; +import { setAllureEpic } from "@helpers/allure"; import { expect } from "@playwright/test"; test.use({ storageState: ".auth/user01.json", wallet: user01Wallet }); +test.beforeEach(async () => { + await setAllureEpic("5. Proposal functionality"); +}); + test("5J. Should hide retirement option for non-registered DRep", async ({ page, }) => { diff --git a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts index 09ae840ff..a1cf6ee2f 100644 --- a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts +++ b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.loggedin.spec.ts @@ -1,13 +1,18 @@ import { user01Wallet } from "@constants/staticWallets"; import { test } from "@fixtures/walletExtension"; import DelegationPage from "@pages/dRepDirectoryPage"; +import { setAllureEpic } from "@helpers/allure"; import DRepRegistrationPage from "@pages/dRepRegistrationPage"; import { expect } from "@playwright/test"; test.use({ storageState: ".auth/user01.json", wallet: user01Wallet }); +test.beforeEach(async () => { + await setAllureEpic("6. Miscellaneous"); +}); // Skipped: No dRepId to validate -test.skip("6B. Provides error for invalid format", async ({ page }) => { +test("6B. Provides error for invalid format", async ({ page }) => { + test.skip(); // invalid dRep delegation const delegationPage = new DelegationPage(page); await delegationPage.goto(); diff --git a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts index d26feb683..8c632c424 100644 --- a/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts +++ b/tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts @@ -1,11 +1,13 @@ +import { setAllureEpic } from "@helpers/allure"; import { isMobile, openDrawer } from "@helpers/mobile"; import { expect, test } from "@playwright/test"; import environments from "lib/constants/environments"; -test("6C. Navigation within the dApp @smoke @fast", async ({ - page, - context, -}) => { +test.beforeEach(async () => { + await setAllureEpic("6. Miscellaneous"); +}); + +test("6C. Navigation within the dApp", async ({ page, context }) => { await page.goto("/"); if (isMobile(page)) { diff --git a/tests/govtool-frontend/playwright/tests/auth.setup.ts b/tests/govtool-frontend/playwright/tests/auth.setup.ts index a002571cb..34ed65e2a 100644 --- a/tests/govtool-frontend/playwright/tests/auth.setup.ts +++ b/tests/govtool-frontend/playwright/tests/auth.setup.ts @@ -8,6 +8,7 @@ import { } from "@constants/staticWallets"; import { importWallet } from "@fixtures/importWallet"; import { test as setup } from "@fixtures/walletExtension"; +import { setAllureStory, setAllureEpic } from "@helpers/allure"; import LoginPage from "@pages/loginPage"; const dRep01AuthFile = ".auth/dRep01.json"; @@ -15,6 +16,11 @@ const adaHolder01AuthFile = ".auth/adaHolder01.json"; const adaHolder02AuthFile = ".auth/adaHolder02.json"; const user01AuthFile = ".auth/user01.json"; +setup.beforeEach(async () => { + await setAllureEpic("Setup"); + await setAllureStory("Authentication"); +}); + setup("Create DRep 01 auth", async ({ page, context }) => { await importWallet(page, dRep01Wallet); diff --git a/tests/govtool-frontend/playwright/tests/delegation.teardown.ts b/tests/govtool-frontend/playwright/tests/delegation.teardown.ts index 986ab1a45..343dde873 100644 --- a/tests/govtool-frontend/playwright/tests/delegation.teardown.ts +++ b/tests/govtool-frontend/playwright/tests/delegation.teardown.ts @@ -1,11 +1,15 @@ import environments from "@constants/environments"; import { adaHolderWallets } from "@constants/staticWallets"; +import { setAllureStory, setAllureEpic } from "@helpers/allure"; import { pollTransaction } from "@helpers/transaction"; import { test as cleanup } from "@playwright/test"; import kuberService from "@services/kuberService"; cleanup.describe.configure({ timeout: environments.txTimeOut }); - +cleanup.beforeEach(async () => { + await setAllureEpic("Setup"); + await setAllureStory("Cleanup"); +}); cleanup(`Abstain delegation`, async () => { const stakePrivKeys = adaHolderWallets.map((wallet) => wallet.stake.private); const stakePkhs = adaHolderWallets.map((wallet) => wallet.stake.pkh); diff --git a/tests/govtool-frontend/playwright/tests/faucet.setup.ts b/tests/govtool-frontend/playwright/tests/faucet.setup.ts index 5aeb32639..52cdce8c9 100644 --- a/tests/govtool-frontend/playwright/tests/faucet.setup.ts +++ b/tests/govtool-frontend/playwright/tests/faucet.setup.ts @@ -1,4 +1,5 @@ import { faucetWallet } from "@constants/staticWallets"; +import { setAllureStory, setAllureEpic } from "@helpers/allure"; import { pollTransaction } from "@helpers/transaction"; import { test as setup } from "@playwright/test"; import { loadAmountFromFaucet } from "@services/faucetService"; @@ -7,6 +8,11 @@ import environments from "lib/constants/environments"; setup.describe.configure({ mode: "serial", timeout: environments.txTimeOut }); +setup.beforeEach(async () => { + await setAllureEpic("Setup"); + await setAllureStory("Fund"); +}); + setup("Fund faucet wallet", async () => { const balance = await kuberService.getBalance(faucetWallet.address); if (balance > 2000) return; diff --git a/tests/govtool-frontend/playwright/tests/wallet.bootstrap.ts b/tests/govtool-frontend/playwright/tests/wallet.bootstrap.ts index 95687585b..2bcc49c80 100644 --- a/tests/govtool-frontend/playwright/tests/wallet.bootstrap.ts +++ b/tests/govtool-frontend/playwright/tests/wallet.bootstrap.ts @@ -1,4 +1,5 @@ import { adaHolderWallets, dRepWallets } from "@constants/staticWallets"; +import { setAllureStory, setAllureEpic } from "@helpers/allure"; import { pollTransaction } from "@helpers/transaction"; import { expect, test as setup } from "@playwright/test"; import kuberService from "@services/kuberService"; @@ -6,7 +7,12 @@ import environments from "lib/constants/environments"; setup.describe.configure({ mode: "serial", timeout: environments.txTimeOut }); +setup.beforeEach(async () => { + await setAllureEpic("Setup"); +}); + setup("Fund static wallets", async () => { + await setAllureStory("Fund"); const addresses = [...adaHolderWallets, ...dRepWallets].map((e) => e.address); const res = await kuberService.transferADA(addresses); await pollTransaction(res.txId); @@ -14,6 +20,7 @@ setup("Fund static wallets", async () => { for (const wallet of [...adaHolderWallets, ...dRepWallets]) { setup(`Register stake of static wallet: ${wallet.address}`, async () => { + await setAllureStory("Register stake"); try { const { txId, lockInfo } = await kuberService.registerStake( wallet.stake.private, From 8c354eb9e0610301a8e59a54fb45ee2504bc9509 Mon Sep 17 00:00:00 2001 From: Nabin Kawan Date: Mon, 20 May 2024 14:52:24 +0545 Subject: [PATCH 2/2] Remove worfkflow changes --- .github/workflows/test_integration_playwright.yml | 15 ++------------- tests/govtool-frontend/playwright/.gitignore | 3 ++- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test_integration_playwright.yml b/.github/workflows/test_integration_playwright.yml index d0a9cd365..80f0cb971 100644 --- a/.github/workflows/test_integration_playwright.yml +++ b/.github/workflows/test_integration_playwright.yml @@ -2,19 +2,8 @@ name: Integration Test [Playwright] on: push: - branches: - - enhancement/allure-report - workflow_dispatch: - inputs: - logLevel: - description: "Log level" - required: true - default: "warning" - type: choice - options: - - info - - warning - - debug + paths: + - .github/workflows/test_integration_playwright.yml workflow_run: workflows: ["Build and deploy GovTool test stack"] types: [completed] diff --git a/tests/govtool-frontend/playwright/.gitignore b/tests/govtool-frontend/playwright/.gitignore index 7ae7583b0..dbf682933 100644 --- a/tests/govtool-frontend/playwright/.gitignore +++ b/tests/govtool-frontend/playwright/.gitignore @@ -12,4 +12,5 @@ allure-results/ allure-report/ .secrets .vars -lock_logs.txt +.lock-pool/ +.logs/ \ No newline at end of file