Skip to content

Commit

Permalink
log fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelangarano committed Sep 11, 2023
1 parent 9369b8e commit cd64d3a
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 465 deletions.
1 change: 1 addition & 0 deletions e2e/cypress-12-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"test": "ts-node scripts/test.ts"
},
"dependencies": {
"colors": "^1.4.0",
"cypress-cloud": "*"
},
"devDependencies": {
Expand Down
20 changes: 20 additions & 0 deletions e2e/cypress-12-demo/scripts/test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import fs from "fs";
import { expect } from "chai";
import { run } from "cypress-cloud";
import colors from "colors";
colors.enable();

type ComparisonResult = {
path: string;
Expand Down Expand Up @@ -232,6 +234,10 @@ const avoidableProperties: { property: string; mustHave: boolean }[] = [
property: "commit.sha",
mustHave: true,
},
{
property: "cypressVersion",
mustHave: true,
},
];

function isAvoidableProperty(property: string) {
Expand Down Expand Up @@ -334,14 +340,28 @@ async function getApiData(runUrl: string) {
modifiedCurrentApi
);

console.log("Starting test: Currents API output".yellow);

testEachResults(currentsApiResults);

console.log(
"Test Passed: Currents API output is the same in ccy 1.9 cypress 12 without change and ccy 1.9 cypress 12 with changes"
.green
);

console.log("Starting test: Cypress Cloud output".yellow);

const cypressCloudResults = compareObjectsRecursively(
originalCypressCloud,
modifiedCypressCloud
);

testEachResults(cypressCloudResults);

console.log(
"Test Passed: Cypress Cloud output is the same in ccy 1.9 cypress 12 without change and ccy 1.9 cypress 12 with changes"
.green
);
} catch (err) {
console.error("Process error:", err);
}
Expand Down
3 changes: 2 additions & 1 deletion e2e/cypress-13-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"test": "ts-node scripts/test.ts"
},
"dependencies": {
"colors": "^1.4.0",
"cypress-cloud": "*"
},
"devDependencies": {
Expand All @@ -16,4 +17,4 @@
"tsconfig": "*",
"typescript": "^4.7.4"
}
}
}
1 change: 0 additions & 1 deletion e2e/cypress-13-demo/scripts/files.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import assert from "assert";
import { run } from "cypress-cloud";
import fs from "fs";

Expand Down
28 changes: 28 additions & 0 deletions e2e/cypress-13-demo/scripts/test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import fs from "fs";
import { expect } from "chai";
import { run } from "cypress-cloud";
import colors from "colors";
colors.enable();

type ComparisonResult = {
path: string;
Expand Down Expand Up @@ -224,6 +226,18 @@ const avoidableProperties: { property: string; mustHave: boolean }[] = [
property: "runUrl",
mustHave: true,
},
{
property: "commit.message",
mustHave: true,
},
{
property: "commit.sha",
mustHave: true,
},
{
property: "cypressVersion",
mustHave: true,
},
];

function isAvoidableProperty(property: string) {
Expand Down Expand Up @@ -326,14 +340,28 @@ async function getApiData(runUrl: string) {
modifiedCurrentApi
);

console.log("Starting test: Currents API output".yellow);

testEachResults(currentsApiResults);

console.log(
"Test Passed: Currents API output is the same in ccy 1.9 cypress 12 without change and ccy 1.9 cypress 12 with changes"
.green
);

console.log("Starting test: Cypress Cloud output".yellow);

const cypressCloudResults = compareObjectsRecursively(
originalCypressCloud,
modifiedCypressCloud
);

testEachResults(cypressCloudResults);

console.log(
"Test Passed: Cypress Cloud output is the same in ccy 1.9 cypress 12 without change and ccy 1.9 cypress 12 with changes"
.green
);
} catch (err) {
console.error("Process error:", err);
}
Expand Down
Loading

0 comments on commit cd64d3a

Please sign in to comment.