Skip to content

Commit

Permalink
format & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Nora01K committed Jul 25, 2024
1 parent e1beb95 commit 351d9a9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
6 changes: 3 additions & 3 deletions test-results/.last-run.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"status": "passed",
"failedTests": []
}
"status": "passed",
"failedTests": []
}
38 changes: 21 additions & 17 deletions tests/resetPwd.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,33 @@ import { expect, test } from '@playwright/test';
import { login } from './testMethods';

test('Reset Password is visible', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('button', { name: 'Click here', exact: true }).first()).toBeVisible();
await page.goto('/');
await expect(page.getByRole('button', { name: 'Click here', exact: true }).first()).toBeVisible();
});

test('Reset Password is not visible when logged in', async ({ page }) => {
await login(page);
await expect(page.getByRole('button', { name: 'Click here', exact: true }).first()).not.toBeVisible();
await login(page);
await expect(
page.getByRole('button', { name: 'Click here', exact: true }).first()
).not.toBeVisible();
});

test('Reset Password Button works', async ({ page }) => {
await page.goto('/');
await page.getByRole('button', { name: 'Click here', exact: true }).click();
await page.waitForTimeout(1000);
await expect(page.getByText("Reset Password", { exact: true }).first()).toBeVisible();
await page.goto('/');
await page.getByRole('button', { name: 'Click here', exact: true }).click();
await page.waitForTimeout(1000);
await expect(page.getByText('Reset Password', { exact: true }).first()).toBeVisible();
});

test('Reset Password Model works', async ({ page }) => {
await page.goto('/');
await page.getByRole('button', { name: 'Click here', exact: true }).click();
await page.waitForTimeout(1000);
await page.getByRole('textbox', { name: 'username*', exact: true }).fill('emailtest');
await page.getByRole('button', { name: 'Send Code', exact: true }).click();
await expect(page.getByRole('textbox', { name: 'code*', exact: true })).toBeVisible();
await expect(page.getByRole('textbox', { name: 'New Password*', exact: true })).toBeVisible();
await expect(page.getByRole('textbox', { name: 'Repeat New Password*', exact: true })).toBeVisible();
});
await page.goto('/');
await page.getByRole('button', { name: 'Click here', exact: true }).click();
await page.waitForTimeout(1000);
await page.getByRole('textbox', { name: 'username*', exact: true }).fill('emailtest');
await page.getByRole('button', { name: 'Send Code', exact: true }).click();
await expect(page.getByRole('textbox', { name: 'code*', exact: true })).toBeVisible();
await expect(page.getByRole('textbox', { name: 'New Password*', exact: true })).toBeVisible();
await expect(
page.getByRole('textbox', { name: 'Repeat New Password*', exact: true })
).toBeVisible();
});

0 comments on commit 351d9a9

Please sign in to comment.