-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reimplement cy13 comatibility tests
- Loading branch information
Showing
16 changed files
with
395 additions
and
2,185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# E2E Compatibility Tests | ||
|
||
```sh | ||
CURRENTS_RECORD_KEY=<key> CURRENTS_PROJECT_ID=<project> npx jest --watch | ||
CURRENTS_API_BASE_URL=https://api.currents.dev/v1 \ | ||
CURRENTS_API_KEY=<api_key> \ | ||
CURRENTS_RECORD_KEY=<key> \ | ||
CURRENTS_PROJECT_ID=<project> \ | ||
npx jest --watch | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { expect, jest } from "@jest/globals"; | ||
import { fetchRun, runCypressCloud } from "../../utils/utils"; | ||
|
||
import { data } from "../data-references/ccy-1.9.4-cy-12-crapi"; | ||
import { all, config, specs } from "../data-references/ccy-1.9.4-cy-12-cycl"; | ||
const testSpecs = [ | ||
"a.spec.js", | ||
"b.spec.js", | ||
"c.spec.js", | ||
"d.spec.js", | ||
"e.spec.js", | ||
]; | ||
let result: any = null; | ||
|
||
describe("Cypress 13 compatible output", () => { | ||
jest.setTimeout(60 * 1000 * 5); | ||
|
||
beforeAll(async () => { | ||
// import cached from "../data-references/ccy-1.10-cy-13-cycl.json"; | ||
// save the result to a file and read from json for faster development | ||
// result = cached; | ||
result = await runCypressCloud(); | ||
}); | ||
|
||
describe("Run Results", () => { | ||
it("should have compatible summary", async () => { | ||
expect(result).toMatchObject({ | ||
...all, | ||
runs: expect.any(Array), | ||
config: expect.any(Object), | ||
}); | ||
}); | ||
|
||
it("should have compatible config", async () => { | ||
expect(result.config).toMatchObject({ | ||
video: config.video, | ||
version: expect.stringContaining("13."), | ||
}); | ||
}); | ||
|
||
testSpecs.map((spec) => { | ||
it(`${spec}: should be compatible`, async () => { | ||
// @ts-ignore | ||
if (!result?.status === "finished") { | ||
throw new Error("Test did not finish"); | ||
} | ||
|
||
// @ts-ignore | ||
const actual = result.runs.find( | ||
// @ts-ignore | ||
(run) => run.spec.name === spec | ||
); | ||
|
||
// @ts-ignore | ||
expect(actual).toMatchObject(specs[spec]); | ||
}); | ||
}); | ||
}); | ||
|
||
describe("API results", () => { | ||
let apiRun: any = null; | ||
beforeAll(async () => { | ||
const runId = result.runUrl.split("/").pop(); | ||
apiRun = await fetchRun(runId); | ||
}); | ||
|
||
it(`should have compatible API results`, async () => { | ||
expect(apiRun.status).toBe("OK"); | ||
expect(apiRun.data).toMatchObject(data); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.