forked from salahadin-dinsafa/realworld-front
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
42 additions
and
5 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
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,33 @@ | ||
import { test, expect } from '@playwright/test'; | ||
const URL = "http://localhost:3000/"; | ||
|
||
|
||
test.describe.only('Given conduit login page is loaded', ()=> { | ||
test.beforeEach(async ({ page }) =>{ | ||
await page.goto(`${URL}login`); | ||
}) | ||
|
||
test('When entering valid credentials', async ({ page }) => { | ||
const email = 'jose.carrera@conduit.com'; | ||
const password = "123456" | ||
|
||
await page.getByTestId('email-input').fill(email); | ||
await page.getByTestId('password-input').fill(password); | ||
await page.getByTestId('signin-btn').click({force:true}); | ||
|
||
await expect(page.locator('a[href="/profile/jose.carrera"]')).toBeVisible(); | ||
}); | ||
|
||
test.describe('When entering invalid credentials', () =>{ | ||
test('Then login is not successful', async ({ page }) => { | ||
const email = 'invalid@conduit.com'; | ||
const password = "123456" | ||
|
||
await page.getByTestId('email-input').fill(email); | ||
await page.getByTestId('password-input').fill(password); | ||
await page.getByTestId('signin-btn').click({force:true}); | ||
|
||
await expect(page.getByTestId('error-msg')).toContainText('Internal server error'); | ||
}); | ||
}); | ||
}); |
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