-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
51 lines (48 loc) · 1.25 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
45
46
47
48
49
50
51
const { defineConfig } = require('cypress')
const mysql = require('mysql')
function queryTestDb(query, config) { //DATABASE
const connection = mysql.createConnection(config.env.db);
connection.connect();
return new Promise((resolve, reject) => {
connection.query(query, (error, results) => {
if (error) reject(error)
else {
connection.end()
return resolve(results)
}
})
})
}
module.exports = defineConfig({
projectId: "355s4r",//for Cypress CLOUD
retries: {
runMode: 1,//
openMode: 0
},
env: {
url: "https://rahulshettyacademy.com/",
db: {
server: '127.0.0.1',
user: 'root',
password: "Y1012Jqkhkp",
database: "myfirstdatabase"
},
"first_name" : "Filipe"
},
e2e: {
setupNodeEvents(on, config) {
on('task', { //DATABASE
queryDb: (query) => {
return queryTestDb(query, config)
}
})
},
// specPattern: 'cypress/logInForms/*.js',
specPattern: 'cypress/e2e'
},
hideXHRInCommandLog: true,
chromeWebSecurity: false,
video: true,
videosFolder: 'cypress/videos',
// videoUpodOnPasses:true
});