1
1
import { test , expect , Cookie } from '@playwright/test' ;
2
2
import { chromium , firefox , webkit } from 'playwright' ;
3
3
4
- test ( 'has title' , async ( { page } ) => {
5
- await page . goto ( 'https://playwright.dev/' ) ;
6
-
7
- // Expect a title "to contain" a substring.
8
- await expect ( page ) . toHaveTitle ( / P l a y w r i g h t / ) ;
9
- } ) ;
10
-
11
- test ( 'get started link' , async ( { page } ) => {
12
- await page . goto ( 'https://playwright.dev/' ) ;
13
-
14
- // Click the get started link.
15
- await page . getByRole ( 'link' , { name : 'Get started' } ) . click ( ) ;
16
-
17
- // Expects page to have a heading with the name of Installation.
18
- await expect ( page . getByRole ( 'heading' , { name : 'Installation' } ) ) . toBeVisible ( ) ;
19
- } ) ;
20
-
21
- // The end of default test examples.
22
-
23
4
test ( 'should fetch the CF endpoint correctly' , async ( { page } ) => {
24
5
const response = await page . goto ( "https://www.branowl.xyz/action/allow" ) ;
25
6
expect ( response ?. status ( ) ) . toBe ( 200 ) ;
@@ -66,7 +47,7 @@ test('should generate an action token after execute() by clicking the button', a
66
47
const responsePromise = page . waitForResponse ( response =>
67
48
response . url ( ) . includes ( '/token/action' ) &&
68
49
response . request ( ) . method ( ) === 'GET' &&
69
- ! ! response . request ( ) . headers ( ) [ 'x-recaptcha-token' ] // Check if the header exists and is truthy
50
+ ! ! response . request ( ) . headers ( ) [ 'x-recaptcha-token' ] // Check if the header exists
70
51
) ;
71
52
72
53
// Click the "Execute Button"
@@ -84,9 +65,6 @@ test('should generate an action token after execute() by clicking the button', a
84
65
} ) ;
85
66
86
67
test ( 'should get session token after visiting the intended injectJS path' , async ( { page } ) => {
87
- let cookies : Cookie [ ] = [ ] ;
88
- const browser = await chromium . launch ( { headless : true } ) ;
89
- const context = await browser . newContext ( ) ;
90
68
const endpointUrl = "https://www.branowl.xyz/hello.html" ;
91
69
92
70
await page . goto ( `${ endpointUrl } ` ) ;
0 commit comments