File tree 3 files changed +29
-12
lines changed 3 files changed +29
-12
lines changed Original file line number Diff line number Diff line change 1
- username =set_a_username
2
- password =set_a_password
1
+ user_login =set_a_username
2
+ user_pass =set_a_password
Original file line number Diff line number Diff line change
1
+ import { test , expect } from '@playwright/test' ;
2
+
3
+ test . describe . configure ( { mode : 'parallel' } ) ;
4
+ test ( 'test edit posts' , async ( { page } ) => {
5
+ await page . goto ( 'https://msls.co/wp-admin/edit.php' ) ;
6
+
7
+ const mslscol = await page . locator ( '#mslscol' ) ;
8
+ await expect ( mslscol ) . toHaveAttribute ( 'scope' , 'col' ) ;
9
+ } ) ;
10
+
11
+ test ( 'test edit pages' , async ( { page } ) => {
12
+ await page . goto ( 'https://msls.co/wp-admin/edit.php?post_type=page' ) ;
13
+
14
+ const mslscol = await page . locator ( '#mslscol' ) ;
15
+ await expect ( mslscol ) . toHaveAttribute ( 'scope' , 'col' ) ;
16
+ } ) ;
Original file line number Diff line number Diff line change 1
- import { test as setup } from '@playwright/test' ;
1
+ import { test as setup , expect } from '@playwright/test' ;
2
2
import dotenv from 'dotenv' ;
3
3
4
4
const authFile = 'tests/playwright/.auth/user.json' ;
5
5
6
- setup ( 'authenticate' , async ( { request } ) => {
7
- dotenv . config ( { path : 'tests/playwright/.env.local' } ) ;
8
- await request . post ( 'https://msls.co/wp-login.php' , {
9
- form : {
10
- 'log' : 'user' ,
11
- 'pwd' : 'password'
12
- }
13
- } ) ;
14
- await request . storageState ( { path : authFile } ) ;
6
+ setup ( 'authenticate' , async ( { page } ) => {
7
+ dotenv . config ( { path : 'tests/playwright/.env.local' } ) ;
8
+
9
+ await page . goto ( 'https://msls.co/wp-login.php?jetpack-sso-show-default-form=1' ) ;
10
+
11
+ await page . locator ( '#user_login' ) . fill ( process . env . user_login as string ) ;
12
+ await page . locator ( '#user_pass' ) . fill ( process . env . user_pass as string ) ;
13
+ await page . locator ( '#wp-submit' ) . click ( ) ;
14
+
15
+ await page . context ( ) . storageState ( { path : authFile } ) ;
15
16
} ) ;
You can’t perform that action at this time.
0 commit comments