From c4cc3f38b82c722cb5baad8eda6e14c4529ccb76 Mon Sep 17 00:00:00 2001 From: shreybaz Date: Fri, 17 May 2024 01:20:33 +0530 Subject: [PATCH] updated playwright tests, added new testing mail --- .github/workflows/playwright.yml | 2 +- tests/example.spec.js | 74 ++++++++++++++++---------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index f74978c..e3594dc 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -22,7 +22,7 @@ jobs: - name: run playwright id: tests - run: npx playwright test --project=firefox + run: TESTPARAM= ${{ secrets.TESTING_MAIL_PASSWORD }} npx playwright test --project=firefox continue-on-error: true - name: Notify on Google Chat diff --git a/tests/example.spec.js b/tests/example.spec.js index 4bbf5f0..7d464b5 100644 --- a/tests/example.spec.js +++ b/tests/example.spec.js @@ -93,52 +93,52 @@ test.describe('New test', () => { }); - // test('Test google login', async ({page}) => { + test('Test google login', async ({page}) => { - // // login from wallet: using headfull mode - // try { - // console.log('Log in test'); + // login from wallet: using headfull mode + try { + console.log('Log in test'); - // // const environment_pass = global.expect; - // const environment_pass = process.env.TESTPARAM; - - // await page.waitForTimeout(3000); - - // await page.getByRole('navigation').getByRole('link').nth(3).click(); - // await page.getByRole('button', { name: 'Login to claim your COYNs' }).click(); - // const page1Promise = page.waitForEvent('popup'); - // await page.getByRole('button', { name: 'Google Sign-In' }).click(); - // const page1 = await page1Promise; - // await page1.getByLabel('Email or phone').click(); - // await page1.getByLabel('Email or phone').fill('testautomationyral@googlemail.com'); + // const environment_pass = global.expect; + const environment_pass = process.env.TESTPARAM; + + await page.waitForTimeout(3000); + + await page.getByRole('navigation').getByRole('link').nth(3).click(); + await page.getByRole('button', { name: 'Login to claim your COYNs' }).click(); + const page1Promise = page.waitForEvent('popup'); + await page.getByRole('button', { name: 'Google Sign-In' }).click(); + const page1 = await page1Promise; + await page1.getByLabel('Email or phone').click(); + await page1.getByLabel('Email or phone').fill('yraltesting@gobazzinga.io'); - // await page.waitForTimeout(2000); - // await page1.getByLabel('Email or phone').press('Enter'); + // await page.waitForTimeout(2000); + await page1.getByLabel('Email or phone').press('Enter'); - // await page1.getByLabel('Enter your password').click(); - // await page1.getByLabel('Enter your password').fill(environment_pass); - // await page.waitForTimeout(2000); + await page1.getByLabel('Enter your password').click(); + await page1.getByLabel('Enter your password').fill(environment_pass); + // await page.waitForTimeout(2000); - // await page1.getByLabel('Enter your password').press('Enter'); - // // await page1.pause(); - // await page.waitForTimeout(3000); + await page1.getByLabel('Enter your password').press('Enter'); + // await page1.pause(); + await page.waitForTimeout(3000); - // console.log('Logged in succesfully'); - // // await page.getByRole('navigation').getByRole('link').first().click(); + console.log('Logged in succesfully'); + // await page.getByRole('navigation').getByRole('link').first().click(); - // await page.waitForTimeout(3000); - // //request to the API endpoint to fetch the response - // const response = await fetch('https://yral-metadata.fly.dev/metadata/gzlng-jqzta-5kubz-4nyam-5so2e-tsoio-ijv2s-47dsw-7ksd7-pe3eb-zqe'); - // await page.waitForTimeout(2000); + await page.waitForTimeout(3000); + //request to the API endpoint to fetch the response + const response = await fetch('https://yral-metadata.fly.dev/metadata/gzlng-jqzta-5kubz-4nyam-5so2e-tsoio-ijv2s-47dsw-7ksd7-pe3eb-zqe'); + await page.waitForTimeout(2000); - // console.log(response.status); - // const responseData = await response.json(); - // console.log(responseData); + console.log(response.status); + const responseData = await response.json(); + console.log(responseData); - // } catch (error) { - // console.error("error in login"); - // } - // }); + } catch (error) { + console.error("error in login"); + } + }); // test('TEST UPLOAD FLOW', async ({page}) => {