mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: cypress accept baseUrl from env
This commit is contained in:
1 parent
94e8940369
commit
a6ffd6b037
4 files changed
+12
-5
No files matched your search
@@ -1,9 +1,12 @@
|
||||
const { defineConfig } = require('cypress')
|
||||
const process = require('process')
|
||||
|
||||
const getConfig = (key, defaultValue) => {
|
||||
return process.env[key] || defaultValue
|
||||
}
|
||||
|
||||
module.exports = defineConfig({
|
||||
e2e: {
|
||||
setupNodeEvents(on, config) {
|
||||
// implement node event listeners here
|
||||
},
|
||||
baseUrl: getConfig('BASE_URL', 'http://localhost:5173'),
|
||||
},
|
||||
})
|
||||
@@ -1,7 +1,7 @@
|
||||
/// <reference types="cypress" />
|
||||
describe('example helloworld app', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('http://localhost:5173')
|
||||
cy.visit('/')
|
||||
})
|
||||
|
||||
it('open login page', () => {
|
||||
|
||||
+4
-1
@@ -1,9 +1,12 @@
|
||||
{
|
||||
"name": "e2e",
|
||||
"name": "tests",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "cypress run"
|
||||
},
|
||||
"dependencies": {
|
||||
"cypress": "^13.2.0"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user