Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress: Update dependencies, migrate folder structure for cypress v10+ #426

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CypressTests/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { defineConfig } = require('cypress')

module.exports = defineConfig({
failOnStatusCode: 'false',
userAgent: 'AcademiesApi/1.0 Cypress',
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)
},
},
})
3 changes: 0 additions & 3 deletions CypressTests/cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
describe("Health Check and Database Check", () => {
let apiKey = Cypress.env('apiKey');
let url = Cypress.env('url')
let urn;

it('Health Check', () => {
cy.request({
cy.api({
method : 'GET',
failOnStatusCode: false,
url: url+"HealthCheck",
url: url+"/HealthCheck",
headers: {
ApiKey: apiKey,
"Content-type" : "application/json"
}
})
.should((response)=>{
.then((response)=>{
expect(response.body).to.contain('Health check ok');
expect(response.status).to.eq(200);
cy.log(JSON.stringify(response.body));
})
});

it('Database Check', () => {
cy.request({
cy.api({
method : 'GET',
failOnStatusCode: false,
url: url+"check_db",
Expand All @@ -30,7 +29,7 @@ describe("Health Check and Database Check", () => {
"Content-type" : "application/json"
}
})
.should((response)=>{
.then((response)=>{
expect(response.status).to.eq(200);
expect(response.body).to.eq(true);
cy.log("Database Check = "+JSON.stringify(response.body));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ describe("GET fss-projects", () => {
let apiKey = Cypress.env('apiKey');
let url = Cypress.env('url')
it("Should return a valid 200 response", () => {
cy.request({
cy.api({
failOnStatusCode: false,
url: url+"/v2/fss/projects",
headers: {
Expand All @@ -13,7 +13,7 @@ describe("GET fss-projects", () => {
});

it("Should return a valid 401 response when omitting API key", () => {
cy.request({
cy.api({
failOnStatusCode: false,
url: url+"/v2/fss/projects",
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@
// Import commands.js using ES2015 syntax:
import './commands'

import 'cypress-plugin-api'

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