|
1 |
| -describe('>>> Swagger Test', () => { |
| 1 | +/* |
| 2 | + * This program and the accompanying materials are made available under the terms of the |
| 3 | + * Eclipse Public License v2.0 which accompanies this distribution, and is available at |
| 4 | + * https://www.eclipse.org/legal/epl-v20.html |
| 5 | + * |
| 6 | + * SPDX-License-Identifier: EPL-2.0 |
| 7 | + * |
| 8 | + * Copyright Contributors to the Zowe Project. |
| 9 | + */ |
| 10 | +describe('>>> Swagger Try Out and Code Snippets Test', () => { |
2 | 11 | beforeEach(() => {
|
3 | 12 | cy.visit(`${Cypress.env('catalogHomePage')}/#/login`);
|
4 | 13 |
|
@@ -54,4 +63,22 @@ describe('>>> Swagger Test', () => {
|
54 | 63 | .find('.response-col_status')
|
55 | 64 | .should('contain', '401');
|
56 | 65 | });
|
| 66 | + |
| 67 | + it('Should execute request and display basic code snippets', () => { |
| 68 | + cy.get('.opblock-summary').eq(0).click(); |
| 69 | + cy.get('.try-out').should('exist'); |
| 70 | + cy.get('.try-out').click(); |
| 71 | + |
| 72 | + cy.get('button.execute').click(); |
| 73 | + // check the first tab of the code snippet panel. The order should be always the same |
| 74 | + cy.get( |
| 75 | + '#operations-API_Catalog-getAllAPIContainersUsingGET > div.no-margin > div > div.responses-wrapper > div.responses-inner > div > div > div:nth-child(1) > div:nth-child(1)' |
| 76 | + ).should('exist'); |
| 77 | + cy.get('div.curl-command > div:nth-child(1) > div:nth-child(1) > h4').should('contain', 'cURL (CMD)'); |
| 78 | + cy.get( |
| 79 | + '#operations-API_Catalog-getAllAPIContainersUsingGET > div.no-margin > div > div.responses-wrapper > div.responses-inner > div > div > div:nth-child(1) > div.curl-command > div:nth-child(3) > pre' |
| 80 | + ).should('exist'); |
| 81 | + cy.get('div.curl-command > div:nth-child(1) > div:nth-child(2)').click(); |
| 82 | + cy.get('div.curl-command > div:nth-child(3) > pre').should('exist'); |
| 83 | + }); |
57 | 84 | });
|
0 commit comments