Skip to content

Commit cbad111

Browse files
authored
Merge pull request #3186 from IntersectMBO/fix/report-352-issue
Fix: report 352 test issue
2 parents dffdecc + acd176e commit cbad111

File tree

10 files changed

+34
-108
lines changed

10 files changed

+34
-108
lines changed

tests/govtool-frontend/playwright/lib/forms/dRepForm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export default class DRepForm {
205205
message:
206206
isPaymentAddressErrorVisible &&
207207
`${dRepInfo.paymentAddress} is an invalid paymentAddress`,
208-
}).toBeHidden();
208+
}).toBeHidden({ timeout: 60_000 });
209209
await expect(this.continueBtn).toBeEnabled();
210210
}
211211

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,10 @@ export const correctDelegatedVoteAdaFormat = (ada: number | undefined) => {
2929
}
3030
return "0";
3131
};
32+
33+
export const correctDRepDirectoryFormat = (ada: number | undefined) => {
34+
if (ada) {
35+
return Number(ada.toFixed(0))?.toLocaleString("en-US");
36+
}
37+
return "0";
38+
};

tests/govtool-frontend/playwright/lib/pages/dRepDirectoryPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export default class DRepDirectoryPage {
217217
!isEmptyContainerVisible &&
218218
`DRep with id ${dRepId} is found in the list`,
219219
}).toBeVisible({
220-
timeout: 20_000,
220+
timeout: 60_000,
221221
});
222222
}
223223
}

tests/govtool-frontend/playwright/tests/2-delegation/delegation.drep.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ test("2N. Should show DRep information on details page", async ({
5656
},
5757
];
5858

59+
await expect(dRepPage.getByTestId("alert-success")).not.toBeVisible();
60+
5961
await dRepRegistrationPage.register({
6062
name,
6163
objectives,
@@ -71,15 +73,18 @@ test("2N. Should show DRep information on details page", async ({
7173
// Add an assertion to prevent clicking on "View Your dRep Details".
7274
await expect(
7375
dRepPage.getByTestId("dRep-id-display-card-dashboard")
74-
).toContainText(wallet.dRepId, { timeout: 20_000 });
76+
).toContainText(wallet.dRepId, { timeout: 60_000 });
7577
await dRepPage.getByTestId("view-drep-details-button").click();
7678

7779
// Verification
7880
await expect(dRepPage.getByTestId("copy-drep-id-button")).toHaveText(
7981
wallet.dRepId
8082
);
8183
await expect(dRepPage.getByTestId("copy-payment-address-button")).toHaveText(
82-
paymentAddress
84+
paymentAddress,
85+
{
86+
timeout: 60_000,
87+
}
8388
);
8489
await expect(dRepPage.getByTestId("Active-pill")).toHaveText("Active");
8590
await expect(dRepPage.getByTestId("voting-power")).toHaveText("₳ 0");

tests/govtool-frontend/playwright/tests/2-delegation/delegationFunctionality.delegation.spec.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import {
1111
} from "@constants/staticWallets";
1212
import { createTempDRepAuth } from "@datafactory/createAuth";
1313
import { test } from "@fixtures/walletExtension";
14-
import { correctDelegatedVoteAdaFormat } from "@helpers/adaFormat";
14+
import {
15+
correctDelegatedVoteAdaFormat,
16+
correctDRepDirectoryFormat,
17+
} from "@helpers/adaFormat";
1518
import { setAllureEpic } from "@helpers/allure";
1619
import { skipIfMainnet, skipIfNotHardFork } from "@helpers/cardano";
1720
import { createNewPageWithWallet } from "@helpers/page";
@@ -265,7 +268,7 @@ test.describe("Abstain delegation", () => {
265268

266269
await expect(
267270
page.getByText(
268-
`You have delegated ₳${correctDelegatedVoteAdaFormat(balance)}`
271+
`You have delegated ₳${correctDRepDirectoryFormat(balance)}`
269272
)
270273
).toBeVisible({
271274
timeout: 60_000,
@@ -296,7 +299,7 @@ test.describe("No confidence delegation", () => {
296299
const balance = await kuberService.getBalance(adaHolder04Wallet.address);
297300
await expect(
298301
page.getByText(
299-
`You have delegated ₳${correctDelegatedVoteAdaFormat(balance)}`
302+
`You have delegated ₳${correctDRepDirectoryFormat(balance)}`
300303
)
301304
).toBeVisible({
302305
timeout: 60_000,
@@ -325,7 +328,7 @@ test.describe("Delegated ADA visibility", () => {
325328
);
326329
await expect(
327330
page.getByText(
328-
`You have delegated ₳ ${correctDelegatedVoteAdaFormat(adaHolderVotingPower)}`
331+
`You have delegated ₳ ${correctDRepDirectoryFormat(adaHolderVotingPower)}`
329332
)
330333
).toBeVisible({ timeout: 60_000 });
331334

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ test.describe("Temporary DReps", () => {
147147
await dRepRegistrationPage.confirmBtn.click();
148148

149149
await expect(dRepPage.getByTestId("d-rep-in-progress")).not.toBeVisible({
150-
timeout: 20_000,
150+
timeout: 60_000,
151151
});
152152

153153
// connected state

tests/govtool-frontend/playwright/tests/3-drep-registration/dRepRegistration.loggedin.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ test.describe("Validation of dRep Registration Form", () => {
5959
const dRepRegistrationPage = new DRepRegistrationPage(page);
6060
await dRepRegistrationPage.goto();
6161

62+
await expect(page.getByTestId("alert-success")).not.toBeVisible();
63+
6264
for (let i = 0; i < 100; i++) {
6365
await dRepRegistrationPage.validateForm({
6466
name: mockValid.name(),
@@ -102,6 +104,7 @@ test.describe("Validation of dRep Registration Form", () => {
102104

103105
const dRepRegistrationPage = new DRepRegistrationPage(page);
104106
await dRepRegistrationPage.goto();
107+
await expect(page.getByTestId("alert-success")).not.toBeVisible();
105108

106109
for (let i = 0; i < 100; i++) {
107110
await dRepRegistrationPage.inValidateForm({

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test.describe("Validation of edit dRep Form", () => {
2525
await editDRepPage.goto();
2626

2727
// wait until wallet alert close
28-
await page.waitForTimeout(5_000);
28+
await expect(page.getByTestId("alert-success")).not.toBeVisible();
2929

3030
for (let i = 0; i < 100; i++) {
3131
await editDRepPage.validateForm({
@@ -73,7 +73,7 @@ test.describe("Validation of edit dRep Form", () => {
7373
const editDRepPage = new EditDRepPage(page);
7474
await editDRepPage.goto();
7575

76-
await expect(editDRepPage.nameInput).toBeVisible({ timeout: 60_000 }); // assert to wait for the page to load
76+
await expect(page.getByTestId("alert-success")).not.toBeVisible();
7777

7878
for (let i = 0; i < 100; i++) {
7979
await editDRepPage.inValidateForm({

tests/govtool-frontend/playwright/tests/5-proposal-functionality/proposalFunctionality.dRep.spec.ts

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import GovernanceActionsPage from "@pages/governanceActionsPage";
1717
import { Page, expect } from "@playwright/test";
1818
import kuberService from "@services/kuberService";
1919
import { BootstrapGovernanceActionType, GovernanceActionType } from "@types";
20+
import { allure } from "allure-playwright";
2021
import walletManager from "lib/walletManager";
2122

2223
test.beforeEach(async () => {
@@ -188,6 +189,9 @@ test.describe("Perform voting", () => {
188189

189190
govActionDetailsPage = await governanceActionsPage.viewFirstVotedProposal();
190191
await govActionDetailsPage.reVote();
192+
193+
await dRepPage.reload();
194+
191195
await governanceActionsPage.votedTab.click();
192196

193197
const isNoVoteVisible = await govActionDetailsPage.currentPage
@@ -269,66 +273,3 @@ test.describe("Check voting power", () => {
269273
expect(balance, "Retirement deposit not returned").toBeGreaterThan(500);
270274
});
271275
});
272-
273-
test.describe("Bootstrap phase", () => {
274-
test("5L. Should restrict dRep votes to Info Governance actions During Bootstrapping Phase", async ({
275-
browser,
276-
}) => {
277-
const voteBlacklistOptions = Object.keys(
278-
BootstrapGovernanceActionType
279-
).filter((option) => option !== GovernanceActionType.InfoAction);
280-
281-
await Promise.all(
282-
voteBlacklistOptions.map(async (voteBlacklistOption) => {
283-
const dRepPage = await createNewPageWithWallet(browser, {
284-
storageState: ".auth/dRep01.json",
285-
wallet: dRep01Wallet,
286-
});
287-
288-
await dRepPage.route("**/epoch/params", async (route) => {
289-
// Fetch the original response from the server
290-
const response = await route.fetch();
291-
const json = await response.json();
292-
293-
// update protocol major version
294-
json["protocol_major"] = 9;
295-
await route.fulfill({
296-
status: 200,
297-
contentType: "application/json",
298-
body: JSON.stringify(json),
299-
});
300-
});
301-
302-
const governanceActionsPage = new GovernanceActionsPage(dRepPage);
303-
await governanceActionsPage.goto();
304-
305-
// assert to wait until proposal cards are visible
306-
await expect(dRepPage.getByTestId("voting-power-chips")).toBeVisible({
307-
timeout: 60_000,
308-
});
309-
// wait until the loading button is hidden
310-
await expect(dRepPage.getByTestId("to-vote-tab")).toBeVisible({
311-
timeout: 60_000,
312-
});
313-
314-
const governanceActionDetailsPage =
315-
await governanceActionsPage.viewFirstProposalByGovernanceAction(
316-
voteBlacklistOption as GovernanceActionType
317-
);
318-
319-
if (governanceActionDetailsPage) {
320-
await expect(
321-
dRepPage.getByTestId("governance-action-details-card-header")
322-
).toBeVisible({ timeout: 60_000 });
323-
await expect(
324-
governanceActionDetailsPage.yesVoteRadio
325-
).not.toBeVisible();
326-
await expect(
327-
governanceActionDetailsPage.contextBtn
328-
).not.toBeVisible();
329-
await expect(governanceActionDetailsPage.voteBtn).not.toBeVisible();
330-
}
331-
})
332-
);
333-
});
334-
});

tests/govtool-frontend/playwright/tests/6-miscellaneous/miscellaneous.spec.ts

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { test } from "@fixtures/walletExtension";
1313
import { setAllureEpic } from "@helpers/allure";
1414
import { isMobile, openDrawer } from "@helpers/mobile";
1515
import { expect, Page } from "@playwright/test";
16+
import { allure } from "allure-playwright";
1617
import environments from "lib/constants/environments";
1718

1819
test.beforeEach(async () => {
@@ -102,40 +103,6 @@ test("6M. Should navigate between footer links", async ({ page, context }) => {
102103
await expect(helpUrl).toHaveURL(HELP_DOC_URL);
103104
});
104105

105-
test("6N. Should Warn users that they are in bootstrapping phase via banner", async ({
106-
page,
107-
context,
108-
}) => {
109-
await page.route("**/epoch/params", async (route) => {
110-
// Fetch the original response from the server
111-
const response = await route.fetch();
112-
const json = await response.json();
113-
114-
// update protocol major version
115-
json["protocol_major"] = 9;
116-
await route.fulfill({
117-
status: 200,
118-
contentType: "application/json",
119-
body: JSON.stringify(json),
120-
});
121-
});
122-
123-
const responsePromise = page.waitForResponse("**/epoch/params");
124-
await page.goto("/");
125-
126-
await responsePromise;
127-
128-
await expect(page.getByTestId("system-bootstrapping-warning")).toBeVisible({
129-
timeout: 60_000,
130-
});
131-
132-
const [bootstrap] = await Promise.all([
133-
context.waitForEvent("page"),
134-
page.getByTestId("system-bootstrapping-warning-link").click(),
135-
]);
136-
await expect(bootstrap).toHaveURL(BOOTSTRAP_DOC_URL);
137-
});
138-
139106
test("6O. Should display proper network name", async ({ page }) => {
140107
await page.route("**/network/metrics", async (route) => {
141108
// Fetch the original response from the server

0 commit comments

Comments
 (0)