Skip to content

Commit

Permalink
updated playwright tests, added new testing mail
Browse files Browse the repository at this point in the history
  • Loading branch information
shreybaz committed May 16, 2024
1 parent aea44f3 commit c4cc3f3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
74 changes: 37 additions & 37 deletions tests/example.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('[email protected]');
// 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('[email protected]');

// 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}) => {

Expand Down

0 comments on commit c4cc3f3

Please sign in to comment.