Skip to content

Commit

Permalink
add dados conexão mongodb
Browse files Browse the repository at this point in the history
  • Loading branch information
mrk-qa committed Aug 14, 2023
1 parent b30fa2a commit 4979710
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
7 changes: 3 additions & 4 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
const { defineConfig } = require('cypress')
const allureWriter = require('@shelex/cypress-allure-plugin/writer')
const mongo = require('cypress-mongodb')
const { uri, dbName, collectionName } = require('./cypress/mongodb/import.js')

module.exports = defineConfig({
projectId: 'eamhmz',
e2e: {
env: {
mongodb: {
uri: uri,
collection: dbName,
database: collectionName,
uri: 'mongodb://mrk-qa:admin@localhost:27017/?authMechanism=DEFAULT',
collection: 'types',
database: 'pokemon',
},
allure: true,
allureResultsPath: 'cypress/reports/allure-results',
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/delete_data.cy.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
const { fakerPT_BR: faker } = require('@faker-js/faker')
const options = { collection: 'types', database: 'pokemon'}

const name = faker.internet.userName().toLowerCase()
const number = Math.floor(Math.random() * 1000)

const options = { collection: Cypress.env('mongodb').collection, database: Cypress.env('mongodb').database }

describe('Excluindo dados do DB', () => {

it('[delete] derruba uma collection', () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/performance_data.cy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const options = { collection: Cypress.env('mongodb').collection, database: Cypress.env('mongodb').database }
const options = { collection: 'types', database: 'pokemon'}

describe('Performance dos dados ao DB', () => {

Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/query_data.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const number = Math.floor(Math.random() * 1000)

const options = { collection: Cypress.env('mongodb').collection, database: Cypress.env('mongodb').database }
const options = { collection: 'types', database: 'pokemon'}

describe('Consultando dados do DB', () => {

Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/update_data.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const number = Math.floor(Math.random() * 1000)

const options = { collection: Cypress.env('mongodb').collection, database: Cypress.env('mongodb').database }
const options = { collection: 'types', database: 'pokemon'}

describe('Atualizando dados do DB', () => {

Expand Down

0 comments on commit 4979710

Please sign in to comment.