|
1 | 1 | import { expect, test } from '@playwright/test';
|
2 | 2 |
|
3 |
| -test('has title', async ({ page }) => { |
4 |
| - await page.goto('https://playwright.dev/'); |
| 3 | +test('achievibit test', async ({ page }) => { |
| 4 | + await page.goto('http://localhost:10101'); |
5 | 5 |
|
6 | 6 | // Expect a title "to contain" a substring.
|
7 |
| - await expect(page).toHaveTitle(/Playwright/); |
| 7 | + await expect(page).toHaveTitle(/achievibit/); |
| 8 | + |
| 9 | + await expect(page.getByRole('heading', { name: 'achievibit' })).toBeVisible(); |
| 10 | +}); |
| 11 | + |
| 12 | +test('login with github', async ({ page }) => { |
| 13 | + await page.goto('http://localhost:10101'); |
| 14 | + |
| 15 | + // Click the login with github button. |
| 16 | + await page.getByRole('link', { name: 'Login with GitHub' }).click(); |
| 17 | + |
| 18 | + // expect to be redirected to github login page |
| 19 | + await expect(page).toHaveURL(/github/); |
| 20 | + await expect(page.getByText('Sign in to GitHub to continue')).toBeVisible(); |
| 21 | +}); |
| 22 | + |
| 23 | +test('login with gitlab', async ({ page }) => { |
| 24 | + await page.goto('http://localhost:10101'); |
| 25 | + |
| 26 | + // Click the login with gitlab button. |
| 27 | + await page.getByRole('link', { name: 'Login with GitLab' }).click(); |
| 28 | + |
| 29 | + // expect to be redirected to gitlab login page |
| 30 | + await expect(page).toHaveURL(/gitlab/); |
| 31 | + await expect(page.getByRole('heading', { name: 'Verify you are human by' })).toBeVisible(); |
8 | 32 | });
|
9 | 33 |
|
10 |
| -test('get started link', async ({ page }) => { |
11 |
| - await page.goto('https://playwright.dev/'); |
| 34 | +test('login with bitbucket', async ({ page }) => { |
| 35 | + await page.goto('http://localhost:10101'); |
12 | 36 |
|
13 |
| - // Click the get started link. |
14 |
| - await page.getByRole('link', { name: 'Get started' }).click(); |
| 37 | + // Click the login with bitbucket button. |
| 38 | + await page.getByRole('link', { name: 'Login with Bitbucket' }).click(); |
15 | 39 |
|
16 |
| - // Expects page to have a heading with the name of Installation. |
17 |
| - await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); |
| 40 | + // expect to be redirected to bitbucket login page |
| 41 | + await expect(page).toHaveURL(/bitbucket/); |
| 42 | + await expect(page.getByTestId('username')).toBeVisible(); |
18 | 43 | });
|
0 commit comments