|
27 | 27 | expect(headers.select { |key| key.to_s.match(/^header/) }).not_to be_blank
|
28 | 28 | expect(headers.fetch('header_0', {}).fetch('name', {})).to eq GrapeSwaggerRails.options.headers.keys.first
|
29 | 29 | find('#endpointListTogger_headers', visible: true).click
|
30 |
| - first('a[href="#!/headers/GET_api_headers_format"]', visible: true).click |
| 30 | + first('span[class="http_method"] a', visible: true).click |
31 | 31 | click_button 'Try it out!'
|
32 | 32 | expect(page).to have_css 'span.attribute', text: 'X-Test-Header'
|
33 | 33 | expect(page).to have_css 'span.string', text: 'Test Value'
|
34 | 34 | end
|
35 | 35 | it 'supports multiple headers' do
|
36 | 36 | find('#endpointListTogger_headers', visible: true).click
|
37 |
| - first('a[href="#!/headers/GET_api_headers_format"]', visible: true).click |
| 37 | + first('span[class="http_method"] a', visible: true).click |
38 | 38 | click_button 'Try it out!'
|
39 | 39 | expect(page).to have_css 'span.attribute', text: 'X-Test-Header'
|
40 | 40 | expect(page).to have_css 'span.string', text: 'Test Value'
|
|
53 | 53 | page.execute_script("$('#input_apiKey').val('username:password')")
|
54 | 54 | page.execute_script("$('#input_apiKey').trigger('change')")
|
55 | 55 | find('#endpointListTogger_headers', visible: true).click
|
56 |
| - first('a[href="#!/headers/GET_api_headers_format"]', visible: true).click |
| 56 | + first('span[class="http_method"] a', visible: true).click |
57 | 57 | click_button 'Try it out!'
|
58 | 58 | expect(page).to have_css 'span.attribute', text: 'Authorization'
|
59 | 59 | expect(page).to have_css 'span.string', text: "Basic #{Base64.encode64('username:password').strip}"
|
|
70 | 70 | page.execute_script("$('#input_apiKey').val('token')")
|
71 | 71 | page.execute_script("$('#input_apiKey').trigger('change')")
|
72 | 72 | find('#endpointListTogger_headers', visible: true).click
|
73 |
| - first('a[href="#!/headers/GET_api_headers_format"]', visible: true).click |
| 73 | + first('span[class="http_method"] a', visible: true).click |
74 | 74 | click_button 'Try it out!'
|
75 | 75 | expect(page).to have_css 'span.attribute', text: 'Authorization'
|
76 | 76 | expect(page).to have_css 'span.string', text: 'Bearer token'
|
|
86 | 86 | page.execute_script("$('#input_apiKey').val('dummy')")
|
87 | 87 | page.execute_script("$('#input_apiKey').trigger('change')")
|
88 | 88 | find('#endpointListTogger_params', visible: true).click
|
89 |
| - first('a[href="#!/params/GET_api_params_format"]', visible: true).click |
| 89 | + first('span[class="http_method"] a', visible: true).click |
90 | 90 | click_button 'Try it out!'
|
91 | 91 | expect(page).to have_css 'span.attribute', text: 'api_token'
|
92 | 92 | expect(page).to have_css 'span.string', text: 'dummy'
|
|
0 commit comments