Skip to content

Commit a0da2b9

Browse files
committed
feat: skip propsoal/ draft creation test for mainnet
1 parent 0958935 commit a0da2b9

File tree

9 files changed

+1169
-17
lines changed

9 files changed

+1169
-17
lines changed

tests/govtool-frontend/playwright/lib/helpers/cardano.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export async function skipIfNotInfoAndBootstrapping(type: ProposalType) {
5050
export async function skipIfMainnet() {
5151
if (environments.networkId === 1) {
5252
await allure.description(
53-
"Ada spendable features are not available on mainnet."
53+
"Test skipped on mainnet to prevent affecting the production environment or using real ADA."
5454
);
5555
test.skip();
5656
}

tests/govtool-frontend/playwright/tests/11-proposal-budget/proposalBudget.loggedin.pb.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { budgetProposal01Wallet } from "@constants/staticWallets";
33
import { faker } from "@faker-js/faker";
44
import { test } from "@fixtures/walletExtension";
55
import { setAllureEpic } from "@helpers/allure";
6+
import { skipIfMainnet } from "@helpers/cardano";
67
import BudgetDiscussionDetailsPage from "@pages/budgetDiscussionDetailsPage";
78
import BudgetDiscussionPage from "@pages/budgetDiscussionPage";
89
import { expect } from "@playwright/test";
@@ -50,6 +51,8 @@ test.describe("Budget proposal logged in state", () => {
5051
});
5152

5253
test("11I. Should comments on any proposal", async ({}) => {
54+
await skipIfMainnet();
55+
5356
const comment = faker.lorem.words(5);
5457
await budgetDiscussionDetailsPage.addComment(comment);
5558
await expect(
@@ -60,6 +63,8 @@ test.describe("Budget proposal logged in state", () => {
6063
});
6164

6265
test("11J. Should reply to any comments", async ({}) => {
66+
await skipIfMainnet();
67+
6368
const randComment = faker.lorem.words(5);
6469
const randReply = faker.lorem.words(5);
6570

tests/govtool-frontend/playwright/tests/12-proposal-budget-submission/proposalBudgetSubmission.loggedin.pb.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
import { faker } from "@faker-js/faker";
1616
import { test } from "@fixtures/budgetProposal";
1717
import { setAllureEpic } from "@helpers/allure";
18+
import { skipIfMainnet } from "@helpers/cardano";
1819
import { createNewPageWithWallet } from "@helpers/page";
1920
import BudgetDiscussionDetailsPage from "@pages/budgetDiscussionDetailsPage";
2021
import BudgetDiscussionPage from "@pages/budgetDiscussionPage";
@@ -421,6 +422,7 @@ test.describe("Budget proposal 01 wallet", () => {
421422
});
422423

423424
test("12C. Should save and view draft proposal", async ({ browser }) => {
425+
await skipIfMainnet();
424426
const page = await createNewPageWithWallet(browser, {
425427
storageState: budgetProposal02AuthFile,
426428
wallet: budgetProposal02Wallet,
@@ -469,6 +471,8 @@ test("12C. Should save and view draft proposal", async ({ browser }) => {
469471
});
470472

471473
test("12H. Should submit a valid budget proposal", async ({ browser }) => {
474+
await skipIfMainnet();
475+
472476
const page = await createNewPageWithWallet(browser, {
473477
storageState: budgetProposal03AuthFile,
474478
wallet: budgetProposal03Wallet,
@@ -489,6 +493,7 @@ test("12H. Should submit a valid budget proposal", async ({ browser }) => {
489493
test("12I. Should submit a valid draft budget proposal", async ({
490494
browser,
491495
}) => {
496+
await skipIfMainnet();
492497
test.slow();
493498
const page = await createNewPageWithWallet(browser, {
494499
storageState: budgetProposal04AuthFile,
@@ -517,6 +522,7 @@ test("12I. Should submit a valid draft budget proposal", async ({
517522
test("12J. Should verify created proposal appears in my proposals list", async ({
518523
browser,
519524
}) => {
525+
await skipIfMainnet();
520526
test.slow();
521527
const page = await createNewPageWithWallet(browser, {
522528
storageState: budgetProposal05AuthFile,

tests/govtool-frontend/playwright/tests/3-drep-registration/editDRep.dRep.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ import { dRep02Wallet } from "@constants/staticWallets";
22
import { faker } from "@faker-js/faker";
33
import { test } from "@fixtures/walletExtension";
44
import { setAllureEpic } from "@helpers/allure";
5-
import { ShelleyWallet } from "@helpers/crypto";
65
import { invalid as mockInvalid, valid as mockValid } from "@mock/index";
76
import {
87
skipIfMainnet,
98
skipIfTemporyWalletIsNotAvailable,
109
} from "@helpers/cardano";
1110
import EditDRepPage from "@pages/editDRepPage";
1211
import { expect } from "@playwright/test";
13-
import environments from "@constants/environments";
1412
import { dRep02AuthFile } from "@constants/auth";
1513
import { generateInvalidDRepInfo, generateValidDRepInfo } from "@helpers/dRep";
1614

tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.ga.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ test.describe("Proposed as a governance action", async () => {
129129
});
130130

131131
test.afterEach(async () => {
132+
await skipIfMainnet();
132133
// cleanup
133134
await proposalDiscussionDetailPage.goto(proposalId);
134135

tests/govtool-frontend/playwright/tests/7-proposal-submission/proposalSubmission.loggedin.pd.spec.ts

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ import { getDraftProposalWalletAndState } from "@helpers/auth";
1818
import {
1919
skipIfNotInfoAndBootstrapping,
2020
isBootStrapingPhase,
21+
skipIfMainnet,
2122
} from "@helpers/cardano";
2223
import { ShelleyWallet } from "@helpers/crypto";
2324
import { createNewPageWithWallet } from "@helpers/page";
24-
import { invalid, valid as mockValid } from "@mock/index";
25+
import { rewardAddressBech32 } from "@helpers/shellyWallet";
2526
import ProposalDiscussionDetailsPage from "@pages/proposalDiscussionDetailsPage";
2627
import ProposalSubmissionPage from "@pages/proposalSubmissionPage";
2728
import { expect } from "@playwright/test";
@@ -132,6 +133,7 @@ test.describe("Proposal created logged state", () => {
132133
page,
133134
wallet,
134135
}) => {
136+
await skipIfMainnet();
135137
await skipIfNotInfoAndBootstrapping(type);
136138

137139
const proposalSubmissionPage = new ProposalSubmissionPage(page);
@@ -308,28 +310,43 @@ test.describe("Proposal created logged state", () => {
308310

309311
test("7O. Should display insufficient balance modal when submitting proposal with insufficient funds", async ({
310312
page,
311-
proposalId,
312313
}) => {
314+
await skipIfMainnet();
315+
const proposalCreationPage = new ProposalSubmissionPage(page);
316+
await proposalCreationPage.goto();
317+
318+
const receiverAddress = rewardAddressBech32(
319+
environments.networkId,
320+
proposal01Wallet.stake.pkh
321+
);
322+
323+
await proposalCreationPage.createProposal(receiverAddress);
324+
313325
const proposalDiscussionDetailsPage = new ProposalDiscussionDetailsPage(
314326
page
315327
);
316-
await proposalDiscussionDetailsPage.goto(proposalId);
317328

318-
await proposalDiscussionDetailsPage.verifyIdentityBtn.click();
319-
await proposalDiscussionDetailsPage.submitAsGABtn.click();
320-
321-
const proposalSubmissionPage = new ProposalSubmissionPage(page);
322-
await expect(
323-
proposalSubmissionPage.currentPage.getByText(
324-
"Insufficient wallet balance",
325-
{ exact: true }
326-
)
327-
).toBeVisible(); // BUG missing test id
329+
try {
330+
await proposalDiscussionDetailsPage.submitAsGABtn.click();
331+
await expect(
332+
proposalCreationPage.currentPage.getByText(
333+
"Insufficient wallet balance",
334+
{ exact: true }
335+
)
336+
).toBeVisible(); // BUG missing test id
337+
338+
await proposalCreationPage.currentPage
339+
.getByRole("button", { name: "Close" })
340+
.click(); // BUG missing test id
341+
} finally {
342+
await proposalDiscussionDetailsPage.deleteProposal();
343+
}
328344
});
329345
});
330346

331347
test.describe("Proposal Draft", () => {
332348
test("7C. Should list unfinished Draft ", async ({ browser }) => {
349+
await skipIfMainnet();
333350
const page = await createNewPageWithWallet(browser, {
334351
storageState: proposal03AuthFile,
335352
wallet: proposal03Wallet,
@@ -346,6 +363,7 @@ test.describe("Proposal Draft", () => {
346363
});
347364

348365
test("7L. Should save proposal as a draft", async ({ browser }) => {
366+
await skipIfMainnet();
349367
const page = await createNewPageWithWallet(browser, {
350368
storageState: proposal04AuthFile,
351369
wallet: proposal04Wallet,
@@ -422,6 +440,7 @@ test.describe("Proposal Draft", () => {
422440
test(`7M_${index + 1}. Should edit a ${proposalType.toLowerCase()} proposal draft`, async ({
423441
browser,
424442
}) => {
443+
await skipIfMainnet();
425444
test.slow();
426445
const { storageState, wallet } =
427446
getDraftProposalWalletAndState(proposalType);
@@ -496,6 +515,7 @@ test.describe("Proposal Draft", () => {
496515
});
497516

498517
test("7N. Should submit a draft proposal", async ({ browser }) => {
518+
await skipIfMainnet();
499519
const page = await createNewPageWithWallet(browser, {
500520
storageState: proposal06AuthFile,
501521
wallet: proposal06Wallet,

tests/govtool-frontend/playwright/tests/8-proposal-discussion/proposalDiscussion.loggedin.pd.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@ import { createNewPageWithWallet } from "@helpers/page";
99
import ProposalDiscussionDetailsPage from "@pages/proposalDiscussionDetailsPage";
1010
import { Page, expect } from "@playwright/test";
1111
import { setAllureEpic } from "@helpers/allure";
12-
import ProposalSubmissionPage from "@pages/proposalSubmissionPage";
1312
import {
1413
proposal01AuthFile,
1514
proposal02AuthFile,
1615
user01AuthFile,
1716
} from "@constants/auth";
17+
import { skipIfMainnet } from "@helpers/cardano";
1818

1919
test.beforeEach(async () => {
2020
await setAllureEpic("8. Proposal Discussion Forum");
21+
await skipIfMainnet();
2122
});
2223

2324
test.describe("Proposal created logged in state", () => {

tests/govtool-frontend/playwright/tests/proposal-submission.ga.auth.setup.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import { test as setup } from "@fixtures/walletExtension";
33
import { createAuthWithUserName } from "@helpers/auth";
44
import walletManager from "lib/walletManager";
55
import { proposalSubmissionAuthFile } from "@constants/auth";
6+
import { skipIfMainnet } from "@helpers/cardano";
67

78
setup.beforeEach(async () => {
89
await setAllureEpic("Setup");
910
await setAllureStory("Authentication");
11+
await skipIfMainnet();
1012
});
1113

1214
setup(

0 commit comments

Comments
 (0)