1+ const assert = require ( 'assert' ) ;
2+ const sideBar = require ( '../pageObjects/Sidebar.js' ) ;
3+
4+
5+ module . exports = ( ) => {
6+ describe ( 'CRUD/History functionality' , function ( ) {
7+
8+ describe ( 'URL/request method inputs' , ( ) => {
9+ it ( 'can type url into url input' , async ( ) => {
10+ await sideBar . url . addValue ( 'pokeapi.co/api/v2/pokemon?limit=5' ) ;
11+ const input = await sideBar . url . getValue ( ) ;
12+
13+ return assert . strictEqual ( input , 'http://pokeapi.co/api/v2/pokemon?limit=5' ) ;
14+ } ) ;
15+
16+ it ( 'can select a request method' , async ( ) => {
17+ await sideBar . requestMethod . click ( ) ;
18+ await sideBar . choosePost . click ( ) ;
19+ let isSelected = await sideBar . choosePost . isSelected ( ) ;
20+ assert . strictEqual ( isSelected , true ) ;
21+
22+ await sideBar . requestMethod . click ( ) ;
23+ await sideBar . chooseGet . click ( ) ;
24+ isSelected = await sideBar . chooseGet . isSelected ( ) ;
25+ assert . strictEqual ( isSelected , true ) ;
26+ } ) ;
27+ } )
28+
29+ // describe('headers inputs', async () => {
30+ // let inputs;
31+ // let headerChecked;
32+
33+ // it('should open headers input, rendering single input at first', async () => {
34+ // await sideBar.activateHeaders.click();
35+ // inputs = await sideBar.headerCheckbox[0];
36+ // assert.strictEqual(inputs.length, 1);
37+ // });
38+
39+ // it('can type new headers in request', async () => {
40+ // await sideBar.headerKey.addValue('testing');
41+ // const headerKey = await sideBar.headerKey.getValue();
42+ // assert.strictEqual(headerKey, 'testing');
43+
44+ // await sideBar.headerValue.addValue('true');
45+ // const headerValue = await sideBar.headerValue.getValue();
46+ // assert.strictEqual(headerValue, 'true');
47+
48+ // });
49+
50+ // it('new headers initialize as checked', async () => {
51+ // headerChecked = await sideBar.headerCheckbox.isSelected();
52+ // assert.strictEqual(headerChecked, true);
53+ // });
54+
55+ // // NOTE : THIS WILL FAIL FOR NOW, THIS IS UI DETAIL THAT NEEDS TO BE IMPLEMENTED IN FUTURE
56+ // it('deleting text in input eliminates checkmark', async () => {
57+ // await sideBar.headerKey.clearValue();
58+ // await sideBar.headerValue.clearVAlue();
59+ // headerChecked = await sideBar.headerCheckbox.isSelected();
60+ // assert.strictEqual(headerChecked, false);
61+ // })
62+ // })
63+
64+ } ) ;
65+ }
0 commit comments