Skip to content

Commit

Permalink
Update cypress dependencies, create v2 documentation test folder and …
Browse files Browse the repository at this point in the history
…some configurations in cypress folders. (#300)
  • Loading branch information
Akellymourab authored Jun 13, 2024
1 parent 7a0e96e commit 31dc8ee
Show file tree
Hide file tree
Showing 29 changed files with 4,167 additions and 4 deletions.
11 changes: 11 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { defineConfig } = require('cypress')

module.exports = defineConfig({
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
},
})
4 changes: 2 additions & 2 deletions cypress/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ const { defineConfig } = require("cypress");

module.exports = defineConfig({
e2e: {
baseUrl: 'https://redesign.testes.map.as',
baseUrl: 'http://localhost',
chromeWebSecurity: false,
setupNodeEvents(on, config) {
},
},
});
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions cypress/e2e/documentationV2Page/index.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
describe('Swagger Documentation Page Test', () => {
beforeEach(() => {
cy.visit("/mapas/docs/v2");
});

it('should load the documentation page without errors', () => {
cy.visit(url);

cy.get('.errors-wrapper').should('not.exist');

cy.contains('API Mapas Culturais V2 - OpenAPI 3.0').should('be.visible');
cy.contains('GET /agents').should('be.visible');
cy.contains('POST /agents').should('be.visible');
cy.contains('GET /agents/{id}').should('be.visible');
cy.contains('PATCH /agents/{id}').should('be.visible');
cy.contains('DELETE /agents/{id}').should('be.visible');
});
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

/**
* @type {Cypress.PluginConfig}
*/
// eslint-disable-next-line no-unused-vars
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
2 changes: 1 addition & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/e2e.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import "./commands";

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading

0 comments on commit 31dc8ee

Please sign in to comment.