-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Chore: Tests refactor pageobjects #26245
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
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
f2b1741
chore: update e2e script name
2238168
refactor: remove useless constants
6d3c066
feat: add ADMIN_CREDENTIALS constant
906be14
feat: create better structured page-objects
a2b434e
test: update omnichannel-departaments suite to use new page-objects
e171019
test: update omnichannel-agents suite to use new page-objects
898c324
test: update forgot-password suite to use new page-objects
042e19c
test: update register suite to use new page-objects
f792470
test: update login suite to use new page-objects
a9405dc
test: update channel-creation suite to use new page-objects
f2e79c5
test: update user-preferences suite to use new page-objects
9bb8e7b
test: update message-popup suite to use new page-objects
cfd5d8b
test: update discussion suite to use new page-objects
8080885
chore: remove render tests
0b8f0c7
fix: general fixes
905ac4e
feat: move locators/actions to the new structure
7a1e7ec
refactor: update tests to use the new page-objects
bbca078
refactor: delete old pageobjects
bd17573
Merge branch 'develop' into refactor/test-pageobjects
882ed4d
fix: apply eslint:fix
b208014
ci: update e2e test script name
5292300
refactor: remove some mocks and unused code~
db35c95
refactor: remove some mocks and unused code~
993fdb0
fix: adjust configurations
weslley543 8b5a3eb
refactor: adjusting and creating a flag for normal login
weslley543 31ef048
refactor: fix .only from function
weslley543 a174a4e
refactor: adjust functon doLogin
weslley543 980369a
Merge branch 'develop' into refactor/test-pageobjects
weslley543 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
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 |
|---|---|---|
| @@ -1,40 +1,45 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
| import { Page, test, expect } from '@playwright/test'; | ||
|
|
||
| import { Global, LoginPage } from './pageobjects'; | ||
| import { Auth } from './page-objects'; | ||
|
|
||
| test.describe('[Forgot Password]', () => { | ||
| let loginPage: LoginPage; | ||
| let global: Global; | ||
| test.describe('Forgot Password', () => { | ||
| let page: Page; | ||
| let pageAuth: Auth; | ||
|
|
||
| test.beforeEach(async ({ page }) => { | ||
| loginPage = new LoginPage(page); | ||
| global = new Global(page); | ||
| test.beforeAll(async ({ browser }) => { | ||
| page = await browser.newPage(); | ||
| pageAuth = new Auth(page); | ||
| }); | ||
|
|
||
| test.beforeAll(async () => { | ||
| await page.goto('/'); | ||
souzaramon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| await loginPage.btnForgotPassword.click(); | ||
| await pageAuth.btnForgotPassword.click(); | ||
| }); | ||
|
|
||
| test('expect be required', async () => { | ||
| loginPage.btnSubmit.click(); | ||
| test('expect trigger a validation error if no email is provided', async () => { | ||
| await pageAuth.btnSubmit.click(); | ||
|
|
||
| await expect(loginPage.emailInvalidText).toBeVisible(); | ||
| await expect(pageAuth.textErrorEmail).toBeVisible(); | ||
| }); | ||
|
|
||
| test('expect invalid for email without domain', async () => { | ||
| await loginPage.emailField.type('mail'); | ||
| await loginPage.btnSubmit.click(); | ||
| await expect(loginPage.emailInvalidText).toBeVisible(); | ||
| test('expect trigger a validation if a invalid email is provided (1)', async () => { | ||
| await pageAuth.inputEmail.type('mail'); | ||
| await pageAuth.btnSubmit.click(); | ||
|
|
||
| await expect(pageAuth.textErrorEmail).toBeVisible(); | ||
| }); | ||
|
|
||
| test('expect be invalid for email with invalid domain', async () => { | ||
| await loginPage.emailField.type('mail@mail'); | ||
| await loginPage.btnSubmit.click(); | ||
| await expect(loginPage.emailInvalidText).toBeVisible(); | ||
| test('expect trigger a validation if a invalid email is provided (2)', async () => { | ||
| await pageAuth.inputEmail.type('mail@mail'); | ||
| await pageAuth.btnSubmit.click(); | ||
|
|
||
| await expect(pageAuth.textErrorEmail).toBeVisible(); | ||
| }); | ||
|
|
||
| test('expect user type a valid email', async () => { | ||
| await loginPage.emailField.type('mail@mail.com'); | ||
| await loginPage.btnSubmit.click(); | ||
| await expect(global.getToastBarSuccess).toBeVisible(); | ||
| test('expect to show a success toast if a valid email is provided', async () => { | ||
| await pageAuth.inputEmail.type('mail@mail.com'); | ||
| await pageAuth.btnSubmit.click(); | ||
|
|
||
| await expect(pageAuth.toastSuccess).toBeVisible(); | ||
| }); | ||
| }); | ||
Oops, something went wrong.
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.