Skip to content

Commit

Permalink
Add cypress.config.js
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <cwperx@amazon.com>
  • Loading branch information
cwperks committed Feb 6, 2025
1 parent 379c0d2 commit 478728e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
35 changes: 25 additions & 10 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const { defineConfig } = require("cypress");
const fs = require("fs");
const path = require("path");

module.exports = defineConfig({
e2e: {
Expand All @@ -17,16 +15,33 @@ module.exports = defineConfig({
username: "admin",
password: "admin",
},
clientCertificates: [
{
url: "https://localhost:9200/.opendistro-ism*",
ca: ["cypress/resources/root-ca.pem"],
certs: [
{
cert: "cypress/resources/kirk.pem",
key: "cypress/resources/kirk-key.pem",
passphrase: "",
},
],
},
{
url: "https://localhost:9200/.opendistro-ism-config/_update_by_query/",
ca: ["cypress/resources/root-ca.pem"],
certs: [
{
cert: "cypress/resources/kirk.pem",
key: "cypress/resources/kirk-key.pem",
passphrase: "",
},
],
},
],
setupNodeEvents(on, config) {
on("task", {
readCertAndKey() {
const cert = fs.readFileSync(path.resolve(__dirname, "cypress/resources/kirk.pem"));
const key = fs.readFileSync(path.resolve(__dirname, "cypress/resources/kirk-key.pem"));
return { cert, key };
},
});
// implement node event listeners here
return config;
},
},
});
});
2 changes: 1 addition & 1 deletion cypress/resources/kirk-key.pem
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ nBY2S57MSM11/MVslrEgGmYNnI4r1K25xlaqV6K6ztEJv6n69327MS4NG8L/gCU5
mQGwy8vIqMjAdHGLrCS35sVYBXG13knS52LJHvbVee39AbD5/LlWvjJGlQMzCLrw
F7oILW5kXxhb8S73GWcuMbuQMFVHFONbZAZgn+C9FW4l7XyRdkrbR1MRZ2km8YMs
/AHmo368d4PSNRMMzLHw8Q==
-----END PRIVATE KEY-----
-----END PRIVATE KEY-----
2 changes: 1 addition & 1 deletion cypress/resources/root-ca.pem
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ YuXgN4KrIcMXQIuAXCx407c+pIlT/T1FNn+VQXwi56PYzxQKtlpoKUL3oPQE1d0V
1yVJon6RkUGtqBqKIuLksKwEr//ELnjmXit4LQKSnqKr0FTCB7seIrKJNyb35Qnq
qy9a/Unhokrmdda1tr6MbqU8l7HmxLuSd/Ky+L0eDNtYv6YfMewtjg0TtAnFyQov
rdXmeq1dy9HLo3Ds4AFz3Gx9076TxcRS/iI=
-----END CERTIFICATE-----
-----END CERTIFICATE-----

0 comments on commit 478728e

Please sign in to comment.