-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into monorepo-2
- Loading branch information
Showing
30 changed files
with
4,796 additions
and
1,100 deletions.
There are no files selected for viewing
This file contains 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 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 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,18 @@ | ||
import { PlaywrightTestConfig } from '@playwright/test'; | ||
|
||
const config: PlaywrightTestConfig = { | ||
outputDir: 'tests/e2e/test-failures', | ||
reporter: [['list']], | ||
workers: 1, | ||
use: { | ||
baseURL: process.env.ENTERPRISE ? 'http://localhost:4000' : 'http://localhost:3000', | ||
headless: true, | ||
viewport: { width: 1024, height: 768 }, | ||
ignoreHTTPSErrors: true, | ||
video: 'retain-on-failure', | ||
screenshot: 'only-on-failure', | ||
trace: 'retain-on-failure', | ||
}, | ||
testDir: 'tests/e2e', | ||
}; | ||
export default config; |
This file contains 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,82 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
import SetupWizard from './utils/pageobjects/SetupWizard'; | ||
import { VALID_EMAIL, adminLogin } from './utils/mocks/userAndPasswordMock'; | ||
import { setupWizardStepRegex } from './utils/mocks/urlMock'; | ||
import { HOME_SELECTOR } from './utils/mocks/waitSelectorsMock'; | ||
import LoginPage from './utils/pageobjects/LoginPage'; | ||
|
||
test.describe('[Wizard]', () => { | ||
let setupWizard: SetupWizard; | ||
let loginPage: LoginPage; | ||
test.beforeEach(async ({ page }) => { | ||
setupWizard = new SetupWizard(page); | ||
loginPage = new LoginPage(page); | ||
}); | ||
|
||
test.describe('[Step 2]', async () => { | ||
test.beforeEach(async ({ baseURL }) => { | ||
const baseUrl = baseURL; | ||
await setupWizard.goto(baseUrl as string); | ||
await loginPage.login(adminLogin); | ||
}); | ||
|
||
test('expect required field alert showed when user dont inform data', async () => { | ||
await setupWizard.stepTwoFailedWithBlankFields(); | ||
}); | ||
|
||
test('expect go to Step 3 successfully', async () => { | ||
await setupWizard.stepTwoSuccess(); | ||
await expect(setupWizard.getPage()).toHaveURL(setupWizardStepRegex._3); | ||
}); | ||
}); | ||
|
||
test.describe('[Step 3]', async () => { | ||
test.beforeEach(async () => { | ||
await setupWizard.goto(''); | ||
await loginPage.login(adminLogin); | ||
await setupWizard.stepTwoSuccess(); | ||
}); | ||
|
||
test('expect have email field to register the server', async () => { | ||
await expect(setupWizard.registeredServer()).toBeVisible(); | ||
}); | ||
|
||
test('expect start "Register" button disabled', async () => { | ||
await expect(setupWizard.registerButton()).toBeDisabled(); | ||
}); | ||
|
||
test('expect show an error on invalid email', async () => { | ||
await setupWizard.stepThreeFailedWithInvalidField(); | ||
}); | ||
|
||
test('expect enable "Register" button when email is valid and terms checked', async () => { | ||
await setupWizard.registeredServer().type(VALID_EMAIL); | ||
await setupWizard.agreementField().click(); | ||
await expect(setupWizard.registerButton()).toBeEnabled(); | ||
}); | ||
|
||
test('expect have option for standalone server', async () => { | ||
await expect(setupWizard.standaloneServer()).toBeVisible(); | ||
}); | ||
}); | ||
|
||
test.describe('[Final Step]', async () => { | ||
test.beforeEach(async () => { | ||
await setupWizard.goto(''); | ||
await loginPage.login(adminLogin); | ||
await setupWizard.stepTwoSuccess(); | ||
await setupWizard.stepThreeSuccess(); | ||
}); | ||
|
||
test('expect confirm the standalone option', async () => { | ||
await expect(setupWizard.goToWorkspace()).toBeVisible(); | ||
await expect(setupWizard.standaloneConfirmText()).toBeVisible(); | ||
}); | ||
|
||
test('expect confirm standalone', async () => { | ||
await setupWizard.goToWorkspace().click(); | ||
await setupWizard.waitForSelector(HOME_SELECTOR); | ||
}); | ||
}); | ||
}); |
This file contains 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,39 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
import LoginPage from './utils/pageobjects/LoginPage'; | ||
import { VALID_EMAIL, INVALID_EMAIL, INVALID_EMAIL_WITHOUT_MAIL_PROVIDER } from './utils/mocks/userAndPasswordMock'; | ||
|
||
test.describe('[Forgot Password]', () => { | ||
let loginPage: LoginPage; | ||
|
||
test.beforeEach(async ({ page, baseURL }) => { | ||
loginPage = new LoginPage(page); | ||
const baseUrl = baseURL as string; | ||
await loginPage.goto(baseUrl); | ||
await loginPage.gotToForgotPassword(); | ||
}); | ||
|
||
test('expect be required', async () => { | ||
loginPage.submit(); | ||
|
||
await expect(loginPage.emailInvalidText()).toBeVisible(); | ||
}); | ||
|
||
test('expect invalid for email without domain', async () => { | ||
await loginPage.emailField().type(INVALID_EMAIL_WITHOUT_MAIL_PROVIDER); | ||
await loginPage.submit(); | ||
await expect(loginPage.emailInvalidText()).toBeVisible(); | ||
}); | ||
|
||
test('expect be invalid for email with invalid domain', async () => { | ||
await loginPage.emailField().type(INVALID_EMAIL); | ||
await loginPage.submit(); | ||
await expect(loginPage.emailInvalidText()).toBeVisible(); | ||
}); | ||
|
||
test('expect user type a valid email', async () => { | ||
await loginPage.emailField().type(VALID_EMAIL); | ||
await loginPage.submit(); | ||
await expect(loginPage.getToastMessageSuccess()).toBeVisible(); | ||
}); | ||
}); |
This file contains 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,27 @@ | ||
import { test } from '@playwright/test'; | ||
|
||
import { registerUser, WRONG_PASSWORD } from './utils/mocks/userAndPasswordMock'; | ||
import LoginPage from './utils/pageobjects/LoginPage'; | ||
|
||
test.describe('[Register]', () => { | ||
let loginPage: LoginPage; | ||
|
||
test.beforeEach(async ({ page, baseURL }) => { | ||
const URL = baseURL as string; | ||
loginPage = new LoginPage(page); | ||
await loginPage.goto(URL); | ||
}); | ||
|
||
test('expect user click in register button without data', async () => { | ||
await loginPage.registerFail(); | ||
}); | ||
|
||
test('expect user click in register button with different password', async () => { | ||
await loginPage.registerFailWithDifferentPassword(registerUser, WRONG_PASSWORD); | ||
}); | ||
|
||
test('expect new user is created', async () => { | ||
await loginPage.gotToRegister(); | ||
await loginPage.registerNewUser(registerUser); | ||
}); | ||
}); |
This file contains 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,29 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
import { validUser } from './utils/mocks/userAndPasswordMock'; | ||
import LoginPage from './utils/pageobjects/LoginPage'; | ||
import { HOME_SELECTOR } from './utils/mocks/waitSelectorsMock'; | ||
|
||
test.describe('[Login]', () => { | ||
let loginPage: LoginPage; | ||
|
||
test.beforeEach(async ({ page, baseURL }) => { | ||
const baseUrl = baseURL; | ||
loginPage = new LoginPage(page); | ||
await loginPage.goto(baseUrl as string); | ||
}); | ||
|
||
test('expect user write a password incorrectly', async () => { | ||
const invalidUserPassword = { | ||
email: validUser.email, | ||
password: 'any_password1', | ||
}; | ||
await loginPage.login(invalidUserPassword); | ||
await expect(loginPage.getToastError()).toBeVisible(); | ||
}); | ||
|
||
test('expect user make login', async () => { | ||
await loginPage.login(validUser); | ||
await loginPage.waitForSelector(HOME_SELECTOR); | ||
}); | ||
}); |
Oops, something went wrong.