@@ -44,45 +44,44 @@ module.exports = () => {
4444 cookies = [ ]
4545 ) => {
4646 try {
47- // click and check REST
48- await page . locator ( '#selected-network' ) . click ( ) ;
49- await page . locator ( '#composer >> a >> text=REST' ) . click ( ) ;
47+ // Make sure HTTP2 method is selected
48+ await page . locator ( 'button>> text=HTTP2' ) . click ( ) ;
5049
5150 // click and select METHOD if it isn't GET
5251 if ( method !== 'GET' ) {
53- await page . locator ( '#composer >> button.is- rest' ) . click ( ) ;
54- await page . locator ( `# composer >> a >> text=${ method } ` ) . click ( ) ;
52+ await page . locator ( 'button# rest-method ' ) . click ( ) ;
53+ await page . locator ( `div[id^=" composer"] >> a >> text=${ method } ` ) . click ( ) ;
5554 }
5655
5756 // type in url
58- await page . locator ( '.input-is-medium ' ) . fill ( url ) ;
57+ await page . locator ( '#url-input ' ) . fill ( url ) ;
5958
6059 // set headers
6160 headers . forEach ( async ( { key, value } , index ) => {
6261 await page . locator ( `#header-row${ index } >> [placeholder="Key"]` ) . fill ( key ) ;
6362 await page . locator ( `#header-row${ index } >> [placeholder="Value"]` ) . fill ( value ) ;
64- await page . locator ( 'button:near(:text("Headers"), 5) ' ) . click ( ) ;
63+ await page . locator ( '#add-header ' ) . click ( ) ;
6564 } ) ;
6665
6766 // set cookies
6867 cookies . forEach ( async ( { key, value } , index ) => {
6968 await page . locator ( `#cookie-row${ index } >> [placeholder="Key"]` ) . fill ( key ) ;
7069 await page . locator ( `#cookie-row${ index } >> [placeholder="Value"]` ) . fill ( value ) ;
71- await page . locator ( 'button:near(:text("Cookies"), 5) ' ) . click ( ) ;
70+ await page . locator ( '#add-cookie ' ) . click ( ) ;
7271 } ) ;
7372
7473 // Add BODY as JSON if it isn't GET
7574 if ( method !== 'GET' ) {
7675 // select body type JSON
77- if ( await page . locator ( 'button:visible >> text=text/plain ' ) . count ( ) === 1 ) {
78- await page . locator ( 'button >> text=text/plain ' ) . click ( ) ;
79- await page . locator ( 'a >> text=application/json' ) . click ( ) ;
76+ if ( await page . locator ( '#body-type-select ' ) . innerText ( ) === 'raw' ) {
77+ await page . locator ( '#raw-body-type ' ) . click ( ) ;
78+ await page . locator ( '.dropdown-item >> text=application/json' ) . click ( ) ;
8079 }
8180
8281 // insert JSON content into body
8382 const codeMirror = await page . locator ( '#body-entry-select' ) ;
8483 await codeMirror . click ( ) ;
85- const restBody = await codeMirror . locator ( 'textarea ' ) ;
84+ const restBody = await codeMirror . locator ( '.cm-content ' ) ;
8685
8786 try {
8887 for ( let i = 0 ; i < 100 ; i += 1 ) {
@@ -133,7 +132,6 @@ module.exports = () => {
133132 } ) ;
134133 } ) ;
135134
136- /** *************** !! FOR BELOW TO WORK, YOU MUST ADD YOUR OWN MONGO URI TO A .ENV FILE WITH (MONGO_URI = "YOUR_URI") !! **************** */
137135 describe ( 'httpTest Server' , ( ) => {
138136 before ( 'CLEAR DB' , ( done ) => {
139137 chai
0 commit comments