Skip to content

Commit

Permalink
for local GUI, need to pull .env
Browse files Browse the repository at this point in the history
  • Loading branch information
irvins committed Sep 13, 2024
1 parent 3b63ebd commit 2d6e08e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/package-lock.json
package-lock.json
/.pnp
.pnp.js

Expand Down
5 changes: 5 additions & 0 deletions cypress/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
const { defineConfig } = require('cypress');
const dotenv = require('dotenv');
const path = require('path');
const addCucumberPreprocessorPlugin = require('@badeball/cypress-cucumber-preprocessor').addCucumberPreprocessorPlugin;
const browserify = require('@badeball/cypress-cucumber-preprocessor/browserify').default;

// Load environment variables from .env file
dotenv.config({ path: path.resolve(__dirname, '../.env') });

module.exports = defineConfig({
e2e: {
async setupNodeEvents(on, config) {
Expand Down
1 change: 1 addition & 0 deletions cypress/e2e/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const username = Cypress.env('CYPRESS_USERNAME');
const password = Cypress.env('CYPRESS_PASSWORD');

Given('the user navigates to the login page', () => {
cy.task("log", {username, password});
visitLoginPage();
});

Expand Down
3 changes: 3 additions & 0 deletions cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"browserify": "^17.0.0",
"cypress": "^13.14.2",
"cypress-cucumber-preprocessor": "^4.3.1"
},
"dependencies": {
"dotenv": "^16.4.5"
}
}

0 comments on commit 2d6e08e

Please sign in to comment.