-
Notifications
You must be signed in to change notification settings - Fork 0
Playwright automation: Employer Login and Job Post fixes #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+134
−3
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
853c3a7
Add employer login test cases TC3, TC4, TC5, TC6, TC7
tanushreeganju12 4fdf0a8
fix(playwright): update login email, rename test prefixes to TC, remo…
aakarshitsharma06 f8abde5
ci: add GitHub Actions workflow for Playwright tests
aakarshitsharma06 1f56df8
ci: update triggers for all branches and add repository_dispatch
aakarshitsharma06 930c7fd
ci: pin GitHub Actions to full commit SHAs
aakarshitsharma06 30d7cce
ci: honor frontend_branch input in actions/checkout
aakarshitsharma06 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
| import { AvuaEmployerPage } from '../pages/AvuaEmployerPage'; | ||
|
|
||
| const EMAIL = 'pranjil+test@avua.com'; | ||
| const PASS = 'Test@123'; | ||
|
|
||
| test('TC1 - Valid login redirects to dashboard', async ({ page }) => { | ||
| const employer = new AvuaEmployerPage(page); | ||
| await employer.login(EMAIL, PASS); | ||
| await expect(page).toHaveURL(/\/employer\/dashboard/i); | ||
| }); | ||
|
|
||
| test('TC3 - Sign-in is not clickable when email and password are empty', async ({ page }) => { | ||
| await page.goto('/employer-login'); | ||
|
|
||
| // Switch to Password tab | ||
| const passwordTab = page.getByRole('button', { name: 'Password' }).first(); | ||
| await passwordTab.click(); | ||
|
|
||
| // Try to click Sign in while fields are empty | ||
| const signInButton = page.getByRole('button', { name: 'Sign in' }); | ||
| await expect(signInButton).toBeDisabled(); | ||
| }); | ||
|
|
||
| test('TC4 - Success message is shown and OTP is requested when valid email is submitted', async ({ page }) => { | ||
| await page.goto('/employer-login'); | ||
|
|
||
| // Click One-time code tab | ||
| const otpTab = page.getByRole('button', { name: 'One-time code' }).first(); | ||
| await otpTab.click(); | ||
|
|
||
| // Enter valid work email in "you@company.com" field | ||
| const emailInput = page.getByPlaceholder('you@company.com'); | ||
| await emailInput.fill('pranjil+test@avua.com'); | ||
|
|
||
| // Click Send sign-in code button | ||
| const sendCodeBtn = page.getByRole('button', { name: 'Send sign-in code' }); | ||
| await sendCodeBtn.click(); | ||
|
|
||
| // Verify success message is shown | ||
| await expect(page.getByText('One-time code sent successfully!')).toBeVisible(); | ||
| await expect(page.getByText(/We've sent an one-time code to your email/i)).toBeVisible(); | ||
| }); | ||
|
|
||
| test('TC5 - Displays user doesnt exist when unregistered email is entered', async ({ page }) => { | ||
| await page.goto('/employer-login'); | ||
|
|
||
| // Click One-time code tab | ||
| const otpTab = page.getByRole('button', { name: 'One-time code' }).first(); | ||
| await otpTab.click(); | ||
|
|
||
| // Enter invalid/unregistered email (must have valid format to click button) | ||
| const emailInput = page.getByPlaceholder('you@company.com'); | ||
| await emailInput.fill('user@company.com'); | ||
|
|
||
|
aakarshitsharma06 marked this conversation as resolved.
|
||
| // Click Send sign-in code button | ||
| const sendCodeBtn = page.getByRole('button', { name: 'Send sign-in code' }); | ||
| await sendCodeBtn.click(); | ||
|
|
||
| // Displays user doesn't exist | ||
| await expect(page.getByText(/user does not exist/i)).toBeVisible(); | ||
| }); | ||
|
|
||
| test('TC6 - Send sign-in code button is disabled when email field is empty', async ({ page }) => { | ||
| await page.goto('/employer-login'); | ||
|
|
||
| // Click One-time code tab | ||
| const otpTab = page.getByRole('button', { name: 'One-time code' }).first(); | ||
| await otpTab.click(); | ||
|
|
||
| // Leave "you@company.com" field empty | ||
| const emailInput = page.getByPlaceholder('you@company.com'); | ||
| await expect(emailInput).toBeEmpty(); | ||
|
|
||
| // Verify Send sign-in code button is disabled | ||
| const sendCodeBtn = page.getByRole('button', { name: 'Send sign-in code' }); | ||
| await expect(sendCodeBtn).toBeDisabled(); | ||
| }); | ||
|
|
||
| test('TC7 - Employer is redirected to forgot password page when clicking Forgot password link', async ({ page }) => { | ||
| await page.goto('/employer-login'); | ||
|
|
||
| // Click Password tab | ||
| const passwordTab = page.getByRole('button', { name: 'Password' }).first(); | ||
| await passwordTab.click(); | ||
|
|
||
| // Click "Forgot password?" link (it is rendered as text/button, not an <a> link) | ||
| const forgotPasswordBtn = page.getByText('Forgot password?'); | ||
| await forgotPasswordBtn.click(); | ||
|
|
||
| // Employer is redirected to forgot password page (rendered within same URL path) | ||
| await expect(page.getByText('Reset password in two quick steps')).toBeVisible(); | ||
| await expect(page.getByRole('button', { name: 'Reset password' })).toBeVisible(); | ||
| }); | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.