π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
test(pw): default skip onboarding flow in pw user signup
Ramesh Mane4c6f396d0eae
diff --git a/tests/playwright/pages/OnboardingFlow/index.ts b/tests/playwright/pages/OnboardingFlowPage/index.tssimilarity index 93%rename from tests/playwright/pages/OnboardingFlow/index.tsrename to tests/playwright/pages/OnboardingFlowPage/index.tsindex 0702c64eee..531f5b3a11 100644--- a/tests/playwright/pages/OnboardingFlow/index.ts+++ b/tests/playwright/pages/OnboardingFlowPage/index.ts@@ -122,6 +122,11 @@ export class OnboardingFlowPage extends BasePage {await expect(option).toHaveClass(/nc-selected/);}+ // If it is last question then no need to navigate to next question as we need to perform finish action+ if (await this.isLastQuestion()) {+ return;+ }+await this.navigateToNextQuestion();// Wait for auto-navigation (500ms delay as per useOnboardingFlow)@@ -152,10 +157,10 @@ export class OnboardingFlowPage extends BasePage {* Complete the onboarding flow by navigating through all questions*/async completeOnboardingFlow() {+ await this.get().waitFor({ state: 'visible' });+// Navigate through all questions- let questionIndex = 0;- let flag = true;- while (flag) {+ for (let questionIndex = 0; questionIndex < 25; questionIndex++) {await this.verifyQuestionIndex(questionIndex);const questionType = await this.getCurrentQuestionType();@@ -165,12 +170,7 @@ export class OnboardingFlowPage extends BasePage {await this.handleMultiSelectQuestion({ optionIndexes: [0, 1] });}- /**- * `questionIndex > 25` condition will not be reached in the actual flow,- * but it's a safety net to prevent infinite loops in case of unexpected behavior.- */- if ((await this.isLastQuestion()) || questionIndex > 25) {- flag = false;+ if (await this.isLastQuestion()) {break;}@@ -196,6 +196,8 @@ export class OnboardingFlowPage extends BasePage {* Skip the onboarding flow*/async skipOnboardingFlow({ verify = false }: { verify?: boolean } = {}) {+ await this.get().waitFor({ state: 'visible' });+await this.waitForResponse({uiAction: () => this.skipButton.click(),httpMethodsToMatch: ['PATCH'],diff --git a/tests/playwright/pages/SignupPage/index.ts b/tests/playwright/pages/SignupPage/index.tsindex 94205f8ccd..a684e2f5b6 100644--- a/tests/playwright/pages/SignupPage/index.ts+++ b/tests/playwright/pages/SignupPage/index.ts@@ -2,13 +2,16 @@ import { Page } from '@playwright/test';import BasePage from '../Base';import { ProjectsPage } from '../ProjectsPage';import { expect } from '@playwright/test';+import { OnboardingFlowPage } from '../OnboardingFlowPage';export class SignupPage extends BasePage {readonly projectsPage: ProjectsPage;+ readonly onboardingFlowPage: OnboardingFlowPage;constructor(rootPage: Page) {super(rootPage);this.projectsPage = new ProjectsPage(rootPage);+ this.onboardingFlowPage = new OnboardingFlowPage(rootPage);}prefixEmail(email: string) {@@ -51,7 +54,9 @@ export class SignupPage extends BasePage {await this.rootPage.waitForLoadState('networkidle');if (skipOnboardingFlow) {- // await this.rootPage.locator('button:has-text("Skip")').click();+ await this.onboardingFlowPage.skipOnboardingFlow();+ } else {+ await this.onboardingFlowPage.completeOnboardingFlow();}}}diff --git a/tests/playwright/tests/onboarding-flow.spec.ts b/tests/playwright/tests/onboarding-flow.spec.tsindex 8271a17ea3..9b1486ae75 100644--- a/tests/playwright/tests/onboarding-flow.spec.ts+++ b/tests/playwright/tests/onboarding-flow.spec.ts@@ -1,5 +1,5 @@import { test } from '@playwright/test';-import { OnboardingFlowPage } from '../pages/OnboardingFlow';+import { OnboardingFlowPage } from '../pages/OnboardingFlowPage';test.describe('Onboarding Flow', () => {let onboardingFlowPage: OnboardingFlowPage;@@ -22,7 +22,7 @@ test.describe('Onboarding Flow', () => {test('should skip onboarding flow', async () => {// Skip the flow- await onboardingFlowPage.skipOnboardingFlow();+ await onboardingFlowPage.skipOnboardingFlow({ verify: true });});});});