cypress: unable to access app from window object
cypress: unable to access app from window object I need to access my vuex store in cypress tests, so i added the app to the window object in my main.js: const app = new Vue({ router, store, render: h => h(App) }).$mount("#app"); window.vueApp = app; And then i try to access it in my login command (commands.js): cy .request({ method: "POST", url: "http://localhost:8081/api/v1/login", body: {}, headers: { Authorization: "Basic " + btoa("administrator:12345678") } }) .then(resp => { console.log("app:", window.vueApp); ... window.localStorage.setItem("aq-username", "administrator"); }); but it's always undefined, what am i doing wrong? 1 Answer 1 window that you're using refers to the cypress runner window . If you want to access the...