Skip to content

Commit

Permalink
Package updates in tests for npm install correctness.
Browse files Browse the repository at this point in the history
  • Loading branch information
archfz committed Oct 29, 2023
1 parent fcb3de0 commit c8cecd9
Show file tree
Hide file tree
Showing 19 changed files with 1,562 additions and 361 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/collector/LogCollectCypressFetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports = class LogCollectCypressFetch {
log += ' - ' + options.err.message;
}

debugger;
if (
!isSuccess &&
consoleProps(options)["Response Body"]
Expand Down
2 changes: 1 addition & 1 deletion test/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { defineConfig } = require('cypress')
const preprocessor = require("@badeball/cypress-cucumber-preprocessor");
const createEsbuildPlugin = require("@badeball/cypress-cucumber-preprocessor/esbuild.js");
const createEsbuildPlugin = require("@badeball/cypress-cucumber-preprocessor/esbuild");
const createBundler = require("@bahmutov/cypress-esbuild-preprocessor");
const Promise = require("@babel/core/lib/vendor/import-meta-resolve");

Expand Down
4 changes: 2 additions & 2 deletions test/cypress/integration/fetchApi.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ describe('Fetch Api', () => {

it('Fetch failed without interceptors', () =>
testRealFetchRequest({
url: 'https://www.mocky.io/v2/5ec993803000009700a6ce1f',
url: 'https://run.mocky.io/v3/e2df0c52-dfdd-4a83-a842-7193ef950508',
}));

it('Fetch failed with interceptors', () =>
testRealFetchRequest({
url: 'https://www.mocky.io/v2/5ec993803000009700a6ce1f',
url: 'https://run.mocky.io/v3/e2df0c52-dfdd-4a83-a842-7193ef950508',
interceptPath: 'https://www.mocky.io/**/*',
}));
});
Expand Down
6 changes: 3 additions & 3 deletions test/cypress/integration/requests.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ describe('Requests.', () => {
it('GET should give 500 response status', () => {
cy.request({
method: 'GET',
url: 'http://www.mocky.io/v2/5ec993353000007900a6ce1e',
url: 'https://run.mocky.io/v3/cf7c4ea3-5f3e-416c-ba17-7aa842b1e2d9',
});
});

it('POST should give 400 response status', () => {
cy.request({
method: 'POST',
url: 'http://www.mocky.io/v2/5ec993803000009700a6ce1f',
url: 'https://run.mocky.io/v3/e2df0c52-dfdd-4a83-a842-7193ef950508',
});
});

Expand All @@ -38,7 +38,7 @@ describe('Requests.', () => {
it('cypress logging is disabled in the request', () => {
cy.request({
method: 'POST',
url: 'http://www.mocky.io/v2/5ec993803000009700a6ce1f',
url: 'https://run.mocky.io/v3/e2df0c52-dfdd-4a83-a842-7193ef950508',
log: false,
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/cypress/integration/xhrTypes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('XHR all types.', () => {
it('POST should give 400 response status', () => {
cy.request({
method: 'POST',
url: 'http://www.mocky.io/v2/5ec993803000009700a6ce1f',
url: 'https://run.mocky.io/v3/e2df0c52-dfdd-4a83-a842-7193ef950508',
headers: {
'token': 'test',
},
Expand Down Expand Up @@ -61,7 +61,7 @@ describe('XHR all types.', () => {
networkErrorButton.className = 'network-error btn btn-primary';
networkErrorButton.innerHTML = 'Request error';
networkErrorButton.addEventListener('click', () =>
window.fetch('https://www.mocky.io/v2/5ec993803000009700a6ce1f')
window.fetch('https://run.mocky.io/v3/e2df0c52-dfdd-4a83-a842-7193ef950508')
.then(() => {
networkErrorMessage.innerHTML = 'received response';
}));
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/support/e2e.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import './commands';
import registerCypressGrep from "cypress-grep";
import registerCypressGrep from "@cypress/grep";
import 'cypress-mochawesome-reporter/register';
import utils from "../../../src/utils";

Expand Down
4 changes: 2 additions & 2 deletions test/output/out.spec.always.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,14 @@
{
"type": "cy:request",
"severity": "error",
"message": "GET http://www.mocky.io/v2/5ec993353000007900a6ce1e\nStatus: 500 - Internal Server Error\nResponse body: Hey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API."
"message": "GET https://run.mocky.io/v3/cf7c4ea3-5f3e-416c-ba17-7aa842b1e2d9\nStatus: 500 - Internal Server Error\nResponse body: Hey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API."
}
],
"Requests. -> POST should give 400 response status": [
{
"type": "cy:request",
"severity": "error",
"message": "POST http://www.mocky.io/v2/5ec993803000009700a6ce1f\nStatus: 400 - Bad Request\nResponse body: {\n \"status\": \"Wrong!\",\n \"data\": {\n \"corpo\": \"corpo da resposta\",\n \"titulo\": \"titulo da resposta\"\n }\n}"
"message": "POST https://run.mocky.io/v3/e2df0c52-dfdd-4a83-a842-7193ef950508\nStatus: 400 - Bad Request\nResponse body: {\n \"status\": \"Wrong!\",\n \"data\": {\n \"corpo\": \"corpo da resposta\",\n \"titulo\": \"titulo da resposta\"\n }\n}"
}
],
"Requests. -> PUT should fail": [
Expand Down
4 changes: 2 additions & 2 deletions test/output/out.spec.always.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ cypress/integration/requests.spec.js:
cy:command (X): get .breaking-get

Requests. -> GET should give 500 response status
cy:request (X): GET http://www.mocky.io/v2/5ec993353000007900a6ce1e
cy:request (X): GET https://run.mocky.io/v3/cf7c4ea3-5f3e-416c-ba17-7aa842b1e2d9
Status: 500 - Internal Server Error
Response body: Hey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API.

Requests. -> POST should give 400 response status
cy:request (X): POST http://www.mocky.io/v2/5ec993803000009700a6ce1f
cy:request (X): POST https://run.mocky.io/v3/e2df0c52-dfdd-4a83-a842-7193ef950508
Status: 400 - Bad Request
Response body: {
"status": "Wrong!",
Expand Down
4 changes: 2 additions & 2 deletions test/output/out.spec.onFail.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,14 @@
{
"type": "cy:request",
"severity": "error",
"message": "GET http://www.mocky.io/v2/5ec993353000007900a6ce1e\nStatus: 500 - Internal Server Error\nResponse body: Hey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API."
"message": "GET https://run.mocky.io/v3/cf7c4ea3-5f3e-416c-ba17-7aa842b1e2d9\nStatus: 500 - Internal Server Error\nResponse body: Hey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API."
}
],
"Requests. -> POST should give 400 response status": [
{
"type": "cy:request",
"severity": "error",
"message": "POST http://www.mocky.io/v2/5ec993803000009700a6ce1f\nStatus: 400 - Bad Request\nResponse body: {\n \"status\": \"Wrong!\",\n \"data\": {\n \"corpo\": \"corpo da resposta\",\n \"titulo\": \"titulo da resposta\"\n }\n}"
"message": "POST https://run.mocky.io/v3/e2df0c52-dfdd-4a83-a842-7193ef950508\nStatus: 400 - Bad Request\nResponse body: {\n \"status\": \"Wrong!\",\n \"data\": {\n \"corpo\": \"corpo da resposta\",\n \"titulo\": \"titulo da resposta\"\n }\n}"
}
],
"Requests. -> PUT should fail": [
Expand Down
4 changes: 2 additions & 2 deletions test/output/out.spec.onFail.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ cypress/integration/requests.spec.js:
cy:command (X): get .breaking-get

Requests. -> GET should give 500 response status
cy:request (X): GET http://www.mocky.io/v2/5ec993353000007900a6ce1e
cy:request (X): GET https://run.mocky.io/v3/cf7c4ea3-5f3e-416c-ba17-7aa842b1e2d9
Status: 500 - Internal Server Error
Response body: Hey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API.

Requests. -> POST should give 400 response status
cy:request (X): POST http://www.mocky.io/v2/5ec993803000009700a6ce1f
cy:request (X): POST https://run.mocky.io/v3/e2df0c52-dfdd-4a83-a842-7193ef950508
Status: 400 - Bad Request
Response body: {
"status": "Wrong!",
Expand Down
12 changes: 6 additions & 6 deletions test/output_nested_cucumber_spec/json/cucumber/Happy.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"type": "cy:command",
"severity": "success",
"message": "step\t"
"message": "Before\t"
},
{
"type": "cy:command",
Expand All @@ -19,7 +19,7 @@
{
"type": "cy:command",
"severity": "success",
"message": "step\tI open Happy page"
"message": "Given \t**I open Happy page**"
},
{
"type": "cy:command",
Expand All @@ -29,7 +29,7 @@
{
"type": "cy:command",
"severity": "success",
"message": "step\tI can load comments"
"message": "Then \t**I can load comments**"
},
{
"type": "cy:command",
Expand Down Expand Up @@ -71,7 +71,7 @@
{
"type": "cy:command",
"severity": "success",
"message": "step\t"
"message": "Before\t"
},
{
"type": "cy:command",
Expand All @@ -81,7 +81,7 @@
{
"type": "cy:command",
"severity": "success",
"message": "step\tI open Happy page"
"message": "Given \t**I open Happy page**"
},
{
"type": "cy:command",
Expand All @@ -91,7 +91,7 @@
{
"type": "cy:command",
"severity": "success",
"message": "step\tI can post comment"
"message": "Then \t**I can post comment**"
},
{
"type": "cy:intercept",
Expand Down
12 changes: 6 additions & 6 deletions test/output_nested_cucumber_spec/txt/cucumber/Happy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ cypress/integration/cucumber/Happy.feature:
The Happy -> Opening happy page and getting comments
cy:intercept (K): Method: GET
Matcher: "comments/*"
cy:command (K): step
cy:command (K): Before
cy:command (K): assert expected **0** to be below **2**
cy:command (K): step I open Happy page
cy:command (K): Given **I open Happy page**
cy:command (K): visit /commands/network-requests
cy:command (K): step I can load comments
cy:command (K): Then **I can load comments**
cy:command (K): get .network-btn
cy:command (K): click
cy:xhr (K): GET https://jsonplaceholder.cypress.io/comments/1
Expand All @@ -18,13 +18,13 @@ cypress/integration/cucumber/Happy.feature:
The Happy -> Opening happy page and posting comments
cy:intercept (K): Method: GET
Matcher: "comments/*"
cy:command (K): step
cy:command (K): Before
cy:command (K): assert expected **1** to be below **2**
Actual: 1
Expected: 2
cy:command (K): step I open Happy page
cy:command (K): Given **I open Happy page**
cy:command (K): visit /commands/network-requests
cy:command (K): step I can post comment
cy:command (K): Then **I can post comment**
cy:intercept (K): Method: POST
Matcher: "/comments"
cy:command (K): get .network-post
Expand Down
6 changes: 3 additions & 3 deletions test/output_nested_spec/json/requests.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
{
"type": "cy:request",
"severity": "error",
"message": "GET http://www.mocky.io/v2/5ec993353000007900a6ce1e\nStatus: 500 - Internal Server Error\nResponse body: Hey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API."
"message": "GET https://run.mocky.io/v3/cf7c4ea3-5f3e-416c-ba17-7aa842b1e2d9\nStatus: 500 - Internal Server Error\nResponse body: Hey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API."
}
],
"Requests. -> POST should give 400 response status": [
{
"type": "cy:request",
"severity": "error",
"message": "POST http://www.mocky.io/v2/5ec993803000009700a6ce1f\nStatus: 400 - Bad Request\nResponse body: {\n \"status\": \"Wrong!\",\n \"data\": {\n \"corpo\": \"corpo da resposta\",\n \"titulo\": \"titulo da resposta\"\n }\n}"
"message": "POST https://run.mocky.io/v3/e2df0c52-dfdd-4a83-a842-7193ef950508\nStatus: 400 - Bad Request\nResponse body: {\n \"status\": \"Wrong!\",\n \"data\": {\n \"corpo\": \"corpo da resposta\",\n \"titulo\": \"titulo da resposta\"\n }\n}"
}
],
"Requests. -> PUT should fail": [
Expand All @@ -64,4 +64,4 @@
}
]
}
}
}
4 changes: 2 additions & 2 deletions test/output_nested_spec/txt/requests.spec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ cypress/integration/requests.spec.js:
cy:command (X): get .breaking-get

Requests. -> GET should give 500 response status
cy:request (X): GET http://www.mocky.io/v2/5ec993353000007900a6ce1e
cy:request (X): GET https://run.mocky.io/v3/cf7c4ea3-5f3e-416c-ba17-7aa842b1e2d9
Status: 500 - Internal Server Error
Response body: Hey ya! Great to see you here. Btw, nothing is configured for this request path. Create a rule and start building a mock API.

Requests. -> POST should give 400 response status
cy:request (X): POST http://www.mocky.io/v2/5ec993803000009700a6ce1f
cy:request (X): POST https://run.mocky.io/v3/e2df0c52-dfdd-4a83-a842-7193ef950508
Status: 400 - Bad Request
Response body: {
"status": "Wrong!",
Expand Down
Loading

0 comments on commit c8cecd9

Please sign in to comment.