-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
44 lines (40 loc) · 1.5 KB
/
cypress.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const { defineConfig } = require("cypress");
const AWS = require("aws-sdk");
const localstackEndpoint = "http://localstack:4566";
module.exports = defineConfig({
fixturesFolder: false,
e2e: {
setupNodeEvents(on, config) {
on("task", {
log(message) {
console.log(message);
return null
},
table(message) {
console.table(message);
return null
},
uploadFileToS3({ bucket, key, body }) {
const s3 = new AWS.S3({
endpoint: localstackEndpoint,
s3ForcePathStyle: true,
accessKeyId: "test",
secretAccessKey: "test",
});
return s3.putObject({ Bucket: bucket, Key: key, Body: body }).promise()
.then(() => s3.headObject({ Bucket: bucket, Key: key }).promise())
.then(data => data.VersionId);
},
failed: require("cypress-failed-log/src/failed")()
});
},
baseUrl: "http://localhost:8888/finance-admin",
downloadsFolder: "cypress/downloads",
specPattern: "cypress/e2e/**/*.cy.{js,ts}",
screenshotsFolder: "cypress/screenshots",
supportFile: "cypress/support/e2e.ts",
modifyObstructiveCode: false,
},
viewportWidth: 1000,
viewportHeight: 1000,
});