Explorar o código

chore(e2e): modify cypress e2e tests to no longer depend on web server for hosting h5 static resources

ddx hai 3 semanas
pai
achega
2eeb0f3eed
Modificáronse 3 ficheiros con 7 adicións e 3 borrados
  1. 1 1
      cypress.config.ts
  2. 2 2
      cypress/support/pageObjects/LoginPage.ts
  3. 4 0
      cypress/support/util.ts

+ 1 - 1
cypress.config.ts

@@ -11,7 +11,7 @@ export default defineConfig({
   viewportWidth: 1920,
   viewportHeight: 1080,
   e2e: {
-    baseUrl: 'http://localhost:10086/#/pages/index/index', // Adjust this to match your application's base URL
+    baseUrl: null,//'http://localhost:10086/#/pages/index/index', // Adjust this to match your application's base 
     // specPattern: '__e2e_test__/**/*.spec.ts',
     setupNodeEvents(on, config) {
       on('task', {

+ 2 - 2
cypress/support/pageObjects/LoginPage.ts

@@ -1,8 +1,8 @@
 // import 'cypress';
-
+import {fileIndex} from '../util';
 class LoginPage {
   visit() {
-    cy.visit('/');
+    cy.visit(`${fileIndex}#/pages/index/index`);
   }
 
   getUsernameInput() {

+ 4 - 0
cypress/support/util.ts

@@ -0,0 +1,4 @@
+/**
+ * 作为base url
+ */
+export const fileIndex = './dist/h5/index.html';