-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.ts
34 lines (30 loc) · 1.29 KB
/
cypress.config.ts
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
import {defineConfig} from "cypress";
import {MariaDbConnectionHandler} from "./cypress/support/database/MariaDbConnectionHandler";
import {RabbitPublisher} from "./cypress/support/amqp/RabbitMqPublisher";
const mariaDbConnectionHandler = new MariaDbConnectionHandler();
const rabbitPublisher = new RabbitPublisher();
export default defineConfig({
e2e: {
baseUrl: "https://www.google.com",
setupNodeEvents(on, config) {
on("task", {
async connectMariaDb({query, parameters, databaseSettings}) {
try {
return await mariaDbConnectionHandler.query(databaseSettings, query, parameters);
} catch (err) {
console.log(err);
throw new Error("DB connection was not successful");
}
},
async publishToExchange({exchange, routingKey, messageContent}) {
try {
return await rabbitPublisher.publishToExchange(routingKey, messageContent, exchange);
} catch (err) {
console.log(err);
throw new Error("Message was not published");
}
}
})
},
},
});