From 358b160100406fc03efd0eb744e8b8cdcf8a83a3 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 15 Feb 2024 19:38:11 +0000 Subject: [PATCH] test(playwright): google signin verification --- .../pages/SsoIdpPage/GoogleLoginPage.ts | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/playwright/pages/SsoIdpPage/GoogleLoginPage.ts diff --git a/tests/playwright/pages/SsoIdpPage/GoogleLoginPage.ts b/tests/playwright/pages/SsoIdpPage/GoogleLoginPage.ts new file mode 100644 index 0000000000..23aedca43f --- /dev/null +++ b/tests/playwright/pages/SsoIdpPage/GoogleLoginPage.ts @@ -0,0 +1,31 @@ +import { Page } from '@playwright/test'; +import BasePage from '../Base'; +import { ProjectsPage } from '../ProjectsPage'; +import { expect } from '@playwright/test'; + +export class GoogleLoginPage extends BasePage { + readonly projectsPage: ProjectsPage; + + constructor(rootPage: Page) { + super(rootPage); + this.projectsPage = new ProjectsPage(rootPage); + } + + async goto(title = 'test') { + // reload page to get latest app info + await this.rootPage.reload({ waitUntil: 'networkidle' }); + // click sign in with SAML + await this.rootPage.locator(`button:has-text("Sign in with google")`).click(); + + await this.rootPage.waitForNavigation({ url: /accounts\.google\.com/ }); + } + + get() { + return this.rootPage.locator('html'); + } + + async signIn(_: { email: string }) { + // skipping for now as it requires google account + // todo: later we can mock backend(google oauth2 endpoint calls) to test this + } +}