Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/govtool-frontend/playwright/lib/forms/dRepForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export default class DRepForm {
.getByTestId(formErrors.paymentAddress)
.isVisible();

expect(await this.objectivesInput.textContent(), {
expect(await this.objectivesInput.textContent({ timeout: 60_000 }), {
message:
objectivesInputText !== dRepInfo.objectives &&
`${dRepInfo.objectives} is not equal to ${await this.objectivesInput.textContent()}`,
Expand Down Expand Up @@ -255,7 +255,7 @@ export default class DRepForm {
message:
!isPaymentAddressErrorVisible &&
`${dRepInfo.paymentAddress} is a valid paymentAddress`,
}).toBeVisible();
}).toBeVisible({ timeout: 60_000 });

expect(await this.objectivesInput.textContent(), {
message:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export default class DRepDirectoryPage {

constructor(private readonly page: Page) {}

get currentPage(): Page {
return this.page;
}

async goto() {
await this.page.goto(
`${environments.frontendUrl}/connected/drep_directory`
Expand Down Expand Up @@ -184,7 +188,7 @@ export default class DRepDirectoryPage {
}

async getAllListedDReps() {
await expect(this.searchInput).toBeVisible({ timeout: 10_000 });
await expect(this.searchInput).toBeVisible({ timeout: 60_000 });

await waitedLoop(async () => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,17 @@ export default class ProposalDiscussionPage {
const proposalCards = await this.getAllProposals();

for (const proposalCard of proposalCards) {
const type = await proposalCard
.getByTestId("governance-action-type")
.textContent();
const hasFilter = await validateFunction(proposalCard, filters);
if (!hasFilter) {
const errorMessage = `A governance action type ${type} does not contain on ${filters}`;
throw errorMessage;
if (await proposalCard.isVisible()) {
const type = await proposalCard
.getByTestId("governance-action-type")
.textContent();
const hasFilter = await validateFunction(proposalCard, filters);
if (!hasFilter) {
const errorMessage = `A governance action type ${type} does not contain on ${filters}`;
throw errorMessage;
}
expect(hasFilter).toBe(true);
}
expect(hasFilter).toBe(true);
}
});
}
Expand Down
6 changes: 3 additions & 3 deletions tests/govtool-frontend/playwright/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ export interface outcomeProposal {
}

export interface outcomeMetadata {
authors: any[];
hashAlgorithm: string;
body: outcomeMetadataBody;
metadataStatus: string;
metadataValid: boolean;
data: outcomeMetadataBody;
}

interface outcomeMetadataBody {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ test.describe("DRep dependent tests", () => {
await page.getByTestId(`${dRepId}-delegate-button`).click();

await expect(dRepDirectoryPage.delegationErrorModal).toBeVisible({
timeout: 10_000,
timeout: 60_000,
});
await expect(dRepDirectoryPage.delegationErrorModal).toHaveText(
/UTxO Balance Insufficient/
Expand All @@ -102,7 +102,7 @@ test.describe("DRep dependent tests", () => {
test("2I. Should check validity of DRep Id", async () => {
await dRepDirectoryPage.searchInput.fill(dRepId);
await expect(dRepDirectoryPage.getDRepCard(dRepId)).toBeVisible({
timeout: 20_000,
timeout: 60_000,
});

const wallet = await ShelleyWallet.generate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ test.describe("DRep dependent tests", () => {
await dRepDirectoryPage.searchInput.fill(dRepId);
await page.getByTestId(`${dRepId}-copy-id-button`).click();
await expect(page.getByText("Copied to clipboard")).toBeVisible({
timeout: 10_000,
timeout: 60_000,
});
const copiedTextDRepDirectory = await page.evaluate(() =>
navigator.clipboard.readText()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test.describe("Delegate to others", () => {
.getByTestId(`${dRepId}-delegated-card`)
.getByTestId(`${dRepId}-copy-id-button`)
).toHaveCount(1, {
timeout: 20_000,
timeout: 60_000,
});

// Verify dRepId in dashboard
Expand Down Expand Up @@ -103,7 +103,7 @@ test.describe("Change delegation", () => {
page
.getByTestId(`${dRepIdFirst}-delegated-card`)
.getByTestId(`${dRepIdFirst}-copy-id-button`)
).toHaveText(`(CIP-105) ${dRepIdFirst}`, { timeout: 20_000 });
).toHaveText(`(CIP-105) ${dRepIdFirst}`, { timeout: 60_000 });

// verify delegation
await dRepDirectoryPage.delegateToDRep(dRepIdSecond);
Expand All @@ -114,7 +114,7 @@ test.describe("Change delegation", () => {
page
.getByTestId(`${dRepIdSecond}-delegated-card`)
.getByTestId(`${dRepIdSecond}-copy-id-button`)
).toHaveText(`(CIP-105) ${dRepIdSecond}`, { timeout: 20_000 });
).toHaveText(`(CIP-105) ${dRepIdSecond}`, { timeout: 60_000 });
});
});

Expand Down Expand Up @@ -145,13 +145,13 @@ test.describe("Register DRep state", () => {
await dRepPage.getByTestId("continue-button").click();
await expect(
dRepPage.getByTestId("registration-transaction-submitted-modal")
).toBeVisible({ timeout: 15_000 });
).toBeVisible({ timeout: 60_000 });
await dRepPage.getByTestId("confirm-modal-button").click();
await waitForTxConfirmation(dRepPage);

// Checks in dashboard
await expect(dRepPage.getByText("You are a Direct Voter")).toBeVisible({
timeout: 20_000,
timeout: 60_000,
});
await expect(
dRepPage.getByTestId("register-as-sole-voter-button")
Expand All @@ -168,11 +168,11 @@ test.describe("Register DRep state", () => {
await dRepPage.getByTestId("continue-button").click();
await expect(
dRepPage.getByTestId("registration-transaction-submitted-modal")
).toBeVisible({ timeout: 15_000 });
).toBeVisible({ timeout: 60_000 });
await dRepPage.getByTestId("confirm-modal-button").click();
await waitForTxConfirmation(dRepPage);
await expect(dRepPage.getByText("You are a Direct Voter")).toBeVisible({
timeout: 20_000,
timeout: 60_000,
});

const dRepDirectoryPage = new DRepDirectoryPage(dRepPage);
Expand All @@ -183,12 +183,11 @@ test.describe("Register DRep state", () => {

await expect(
dRepPage.getByText("You Have Retired as a Direct")
).toBeVisible({ timeout: 20_000 });
).toBeVisible({ timeout: 60_000 });
});
});

test("2G. Should delegate to myself", async ({ page, browser }, testInfo) => {
test.skip();
test.setTimeout(testInfo.timeout + environments.txTimeOut);

const wallet = await walletManager.popWallet("registeredDRep");
Expand All @@ -207,14 +206,13 @@ test("2G. Should delegate to myself", async ({ page, browser }, testInfo) => {
await dRepDirectoryPage.delegateToDRep(dRepId);

await expect(
dRepPage.getByTestId(`${dRepId}-delegate-button')`)
).not.toBeVisible();
await expect(dRepPage.getByTestId(`${dRepId}-copy-id-button`)).toHaveCount(
1,
{
timeout: 20_000,
}
);
dRepDirectoryPage.currentPage.getByTestId(`${dRepId}-delegate-button`)
).not.toBeVisible({ timeout: 60_000 });
await expect(
dRepDirectoryPage.currentPage.getByTestId(`${dRepId}-copy-id-button`)
).toHaveCount(1, {
timeout: 60_000,
});
});

test.describe("Multiple delegations", () => {
Expand All @@ -233,14 +231,14 @@ test.describe("Multiple delegations", () => {

await page.getByTestId(`${dRep01Wallet.dRepId}-delegate-button`).click();
await expect(page.getByTestId("alert-warning")).toHaveText(/in progress/i, {
timeout: 15_000,
timeout: 60_000,
});

await dRepDirectoryPage.searchInput.fill(dRep02Wallet.dRepId);
await page.getByTestId(`${dRep02Wallet.dRepId}-delegate-button`).click();

await expect(page.getByTestId("transaction-inprogress-modal")).toBeVisible({
timeout: 15_000,
timeout: 60_000,
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ test("3F. Should create proper DRep registration request, when registered with d
await dRepRegistrationPage.registerWithoutTxConfirmation({ name: "Test" });
await expect(
page.getByTestId("registration-transaction-error-modal")
).toBeVisible({ timeout: 10_000 });
).toBeVisible({ timeout: 60_000 });
});

test("3O. Should reject invalid dRep registration metadata", async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ test.describe("Validation of edit dRep Form", () => {
const editDRepPage = new EditDRepPage(page);
await editDRepPage.goto();

await expect(editDRepPage.nameInput).toBeVisible({ timeout: 20_000 }); // assert to wait for the page to load
await expect(editDRepPage.nameInput).toBeVisible({ timeout: 60_000 }); // assert to wait for the page to load

for (let i = 0; i < 100; i++) {
await editDRepPage.inValidateForm({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test.describe("Logged in DRep", () => {

await expect(page.getByTestId("voting-power-chips-value")).toHaveText(
`₳ ${lovelaceToAda(votingPower)}`,
{ timeout: 20_000 }
{ timeout: 60_000 }
);
});

Expand All @@ -57,7 +57,7 @@ test.describe("Logged in DRep", () => {

// assert to wait until the loading button is hidden
await expect(page.getByTestId("to-vote-tab")).toBeVisible({
timeout: 20_000,
timeout: 60_000,
});

govActionDetailsPage = (await isBootStrapingPhase())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test.describe("Proposal checks", () => {

// assert to wait until the loading button is hidden
await expect(page.getByTestId("to-vote-tab")).toBeVisible({
timeout: 20_000,
timeout: 60_000,
});

currentPage = page;
Expand Down Expand Up @@ -155,7 +155,7 @@ test.describe("Perform voting", () => {

// assert to wait until the loading button is hidden
await expect(dRepPage.getByTestId("to-vote-tab")).toBeVisible({
timeout: 20_000,
timeout: 60_000,
});

govActionDetailsPage = (await isBootStrapingPhase())
Expand Down Expand Up @@ -216,7 +216,7 @@ test.describe("Perform voting", () => {
test.setTimeout(testInfo.timeout + environments.txTimeOut);
await govActionDetailsPage.vote();
await expect(govActionDetailsPage.voteSuccessModal).toBeVisible({
timeout: 20_000,
timeout: 60_000,
});
});

Expand Down Expand Up @@ -261,7 +261,7 @@ test.describe("Check voting power", () => {
await dRepPage.getByTestId("continue-retirement-button").click();
await expect(
dRepPage.getByTestId("retirement-transaction-submitted-modal")
).toBeVisible({ timeout: 15_000 });
).toBeVisible({ timeout: 60_000 });
dRepPage.getByTestId("confirm-modal-button").click();
await waitForTxConfirmation(dRepPage);

Expand Down Expand Up @@ -304,11 +304,11 @@ test.describe("Bootstrap phase", () => {

// assert to wait until proposal cards are visible
await expect(dRepPage.getByTestId("voting-power-chips")).toBeVisible({
timeout: 20_000,
timeout: 60_000,
});
// wait until the loading button is hidden
await expect(dRepPage.getByTestId("to-vote-tab")).toBeVisible({
timeout: 20_000,
timeout: 60_000,
});

const governanceActionDetailsPage =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test("6H. Should restrict dRep registration for dRep", async ({ page }) => {
await page.goto(`${environments.frontendUrl}/register_drep`);

await expect(page.getByText("You already are a DRep")).toBeVisible({
timeout: 20_000,
timeout: 60_000,
});
await expect(page.getByTestId("name-input")).not.toBeVisible();
});
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Object.values(ProposalType).forEach((proposalType, index) => {
await expect(userPage.getByTestId("ga-submitted-modal-title")).toHaveText(
/governance action submitted!/i,
{
timeout: 20_000,
timeout: 60_000,
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ test.describe("Proposal Draft", () => {

await expect(proposalSubmissionPage.governanceActionType).toHaveText(
createProposalType,
{ timeout: 20_000 }
{ timeout: 60_000 }
);
await expect(proposalSubmissionPage.titleInput).toHaveValue(
proposalFormValue.prop_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ test.describe("Proposal created with poll enabled (user auth)", () => {
// vote must be changed
await expect(
page.getByTestId(`poll-${vote.toLowerCase()}-count`)
).toHaveText(`${vote}: (0%)`, { timeout: 15_000 });
).toHaveText(`${vote}: (0%)`, { timeout: 60_000 });
// opposite of random choice vote
const oppositeVote = pollVotes[pollVotes.length - 1 - choice];
await expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ test("8D. Should show the view-all categorized proposed governance actions.", as
for (const proposalCard of proposalCards) {
await expect(
proposalCard.getByTestId("governance-action-type")
).toHaveText(proposalType, { timeout: 20_000 });
).toHaveText(proposalType, { timeout: 60_000 });
}
})
);
Expand Down
Loading