Skip to content

Commit

Permalink
E2E: Work around flakiness loading proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
dskloetd committed Sep 21, 2023
1 parent 131038d commit f9968e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
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

0 comments on commit f9968e1

Please sign in to comment.