Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E: Work around flakiness loading proposals #3342

Merged
merged 1 commit into from
Sep 21, 2023
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
5 changes: 5 additions & 0 deletions frontend/src/lib/pages/NnsProposals.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@
debounceFindProposals?.();
};

// Neurons and proposals are loaded at the same time. But once neurons are
// loaded, proposals are loaded again. So it's possible that the component
// goes back into loading state immediately after proposals are loaded.
// TODO: Fix NnsProposals to load proposals only once and remove the
// work-around from NnsProposalList.page-object.ts
$: $definedNeuronsStore, applyFilter($proposalsFiltersStore);

$: $authStore.identity, (() => proposalsFiltersStore.reload())();
Expand Down
13 changes: 9 additions & 4 deletions frontend/src/tests/page-objects/NnsProposalList.page-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,15 @@ export class NnsProposalListPo extends BasePageObject {
}

async waitForContentLoaded(): Promise<void> {
await Promise.race([
this.getProposalCardPo().waitFor(),
this.waitFor("no-proposals-msg"),
]);
this.getSkeletonCardPo().waitForAbsent();
// The NnsProposals component loads neurons and proposals at the same time.
// But once neurons are loaded, it loads proposals again. So it's possible
// that the component goes back into loading state immediately after
// proposals are loaded.
// TODO: Fix NnsProposals to load proposals only once and remove the 2 lines
// below.
await new Promise((resolve) => setTimeout(resolve, 1000));
this.getSkeletonCardPo().waitForAbsent();
}

async getVisibleProposalIds(proposerNeuronId: string): Promise<string[]> {
Expand Down