| | 1 | import { createURL } from '@wordpress/e2e-test-utils'; |
| | 2 | |
| | 3 | describe( 'The login form', () => { |
| | 4 | it( 'Should contain a username input', async () => { |
| | 5 | await page.goto( createURL( 'wp-login.php' ) ); |
| | 6 | const usernameInput = await page.$( 'input[type="text"][name="log"]' ); |
| | 7 | expect( usernameInput ).not.toBeNull(); |
| | 8 | } ); |
| | 9 | |
| | 10 | it( 'Should contain a password input', async () => { |
| | 11 | await page.goto( createURL( 'wp-login.php' ) ); |
| | 12 | const passwordInput = await page.$( 'input[type="password"][name="pwd"]' ); |
| | 13 | expect( passwordInput ).not.toBeNull(); |
| | 14 | } ); |
| | 15 | |
| | 16 | it( 'Should contain a submit button', async () => { |
| | 17 | await page.goto( createURL( 'wp-login.php' ) ); |
| | 18 | const submitButton = await page.$( 'input[type="submit"][name="wp-submit"]' ); |
| | 19 | expect( submitButton ).not.toBeNull(); |
| | 20 | } ); |
| | 21 | |
| | 22 | it( 'Should contain a rememberme checkbox', async () => { |
| | 23 | await page.goto( createURL( 'wp-login.php' ) ); |
| | 24 | const rembembermeCheckbox = await page.$( 'input[type="checkbox"][name="rememberme"]' ); |
| | 25 | expect( rembembermeCheckbox ).not.toBeNull(); |
| | 26 | } ); |
| | 27 | |
| | 28 | it( 'Should contain a lost your password link', async () => { |
| | 29 | await page.goto( createURL( 'wp-login.php' ) ); |
| | 30 | const lostPasswordUrl = createURL( 'wp-login.php' ) + '?action=lostpassword'; |
| | 31 | const lostPasswordLink = await page.$( `a[href="${ lostPasswordUrl }"]` ); |
| | 32 | expect( lostPasswordLink ).not.toBeNull(); |
| | 33 | } ); |
| | 34 | } ); |