Skip to content

Commit 6576ec6

Browse files
committed
successful login test
1 parent c26dc4e commit 6576ec6

5 files changed

Lines changed: 24 additions & 464 deletions

File tree

pages/login-page.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,42 @@ export class LoginPage{
55
readonly emailInput: Locator;
66
readonly passwordInput: Locator;
77
readonly continueButton: Locator;
8+
readonly continue: Locator;
89

910
constructor(page: Page){
1011
this.page = page;
1112
this.emailInput = page.getByRole('textbox', { name: 'Email' });
1213
this.continueButton = page.getByRole('button', { name: 'Continue', exact: true });
1314
this.passwordInput = page.getByRole('textbox', { name: 'Password' });
15+
this.continue = page.getByRole('button', { name: 'Continue'});
1416

1517
}
1618

1719
async fillEmail(email: string){
1820
await this.emailInput.fill('anchita.dogra@gmail.com');
1921
}
2022

21-
async clickContinue(){
23+
async clickContinueButton(){
2224
await this.continueButton.click();
2325
}
2426

27+
async clickContinue(){
28+
await this.continue.click();
29+
}
30+
2531
async fillPassword(password: string){
2632
await this.passwordInput.fill('Pass123!');
2733
}
2834

2935
async doLogin(email: string, password: string){
3036
await this.fillEmail(email);
31-
await this.clickContinue();
37+
await this.clickContinueButton();
3238
await this.fillPassword(password);
3339
await this.clickContinue();
3440
}
3541

3642
async verifyLogin(){
37-
expect(this.page.url()).toBe('https://www.hudl.com/home');
43+
//await expect(this.page.url()).toBe('https://hudl.com./home');
3844
await expect(this.page).toHaveTitle(/Home - Hudl/);
3945
}
4046
}

playwright.config.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,35 @@ export default defineConfig({
2626
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2727
use: {
2828
/* Base URL to use in actions like `await page.goto('/')`. */
29-
// baseURL: 'http://127.0.0.1:3000',
29+
// baseURL: 'https://hudl.com',
3030

3131
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
32-
trace: 'on-first-retry',
32+
trace: 'on',
33+
headless: false,
3334
},
3435

3536
/* Configure projects for major browsers */
3637
projects: [
3738
{
3839
name: 'chromium',
39-
use: { ...devices['Desktop Chrome'] },
40+
use: {
41+
baseURL: 'https://hudl.com',
42+
...devices['Desktop Chrome']
43+
},
4044
},
4145

4246
{
4347
name: 'firefox',
44-
use: { ...devices['Desktop Firefox'] },
48+
use: {
49+
baseURL: 'https://hudl.com',
50+
...devices['Desktop Firefox'] },
4551
},
4652

4753
{
4854
name: 'webkit',
49-
use: { ...devices['Desktop Safari'] },
55+
use: {
56+
baseURL: 'https://hudl.com',
57+
...devices['Desktop Safari'] },
5058
},
5159

5260
/* Test against mobile viewports. */

0 commit comments

Comments
 (0)