Skip to content

Commit

Permalink
fix: more attempts at stability
Browse files Browse the repository at this point in the history
  • Loading branch information
innerdvations committed Apr 28, 2024
1 parent 777252f commit 3ad0c77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions tests/e2e/tests/admin/signup.spec.ts
Expand Up @@ -28,7 +28,7 @@ test.describe('Sign Up', () => {
await resetDatabaseAndImportDataFromPath('without-admin.tar', (cts) =>
cts.filter((ct) => ct !== 'plugin::i18n.locale')
);
await page.goto('/admin');
await page.goto('/admin', { waitUntil: 'networkidle' });
await fillValidSignUpForm({ page });
});

Expand Down Expand Up @@ -96,7 +96,10 @@ test.describe('Sign Up', () => {
test('a user should be able to signup when the strapi instance starts fresh', async ({
page,
}) => {
await page.getByRole('button', { name: "Let's start" }).click();
await Promise.all([
page.waitForLoadState('networkidle'),
page.getByRole('button', { name: "Let's start" }).click(),
]);

await expect(page).toHaveTitle(TITLE_HOME);
});
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/utils/login.ts
Expand Up @@ -10,10 +10,10 @@ export const login = async ({ page, rememberMe = false }: { page: Page; remember
const maxRetries = 5;
for (let i = 0; i < maxRetries; i++) {
// go to the root page which should be the logged in
await page.goto(URL_ROOT);
await page.goto(URL_ROOT, { waitUntil: 'networkidle' });

// ...unless we already logged in, and are redirected to the home page now
if (i > 0 && (await page.title()) === TITLE_HOME) {
if ((await page.title()) === TITLE_HOME) {
break; // If the page loads successfully, break the loop
}

Expand Down

0 comments on commit 3ad0c77

Please sign in to comment.