Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: failing tests from #18372 #18414

Merged
merged 3 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/app/cypress/integration/basic.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('App', () => {
it('resolves the home page', () => {
cy.visit('http://localhost:5556')
cy.get('[href="/__vite__/runner"]').click()
cy.get('[href="/__vite__/settings"]').click()
cy.get('[data-e2e-href="/runner"]').click()
cy.get('[data-e2e-href="/settings"]').click()
})
})
1 change: 1 addition & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"cypress:launch": "cross-env TZ=America/New_York node ../../scripts/cypress open --project ${PWD}",
"cypress:open": "yarn gulp cyOpenAppE2E",
"cypress:run:e2e": "yarn gulp cyRunAppE2E",
"debug": "gulp debug --project ${PWD}",
"dev": "gulp dev --project ${PWD}",
"start": "echo \"run 'yarn dev' from the root\" && exit 1",
"watch": "echo \"run 'yarn dev' from the root\" && exit 1",
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/navigation/SidebarNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
:to="item.href"
>
<SidebarNavigationRow
:data-e2e-href="item.href"
:active="isActive"
:icon="item.icon"
>
Expand Down
5 changes: 4 additions & 1 deletion packages/app/src/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import { setupLayouts } from 'virtual:generated-layouts'
export const createRouter = () => {
const routes = setupLayouts(generatedRoutes)

// TODO: clean this up
const historyBase = window.location.href.includes('__vite__') ? '__vite__' : ''

return _createRouter({
history: createWebHistory('/__vite__/'),
history: createWebHistory(historyBase),
routes,
})
}
10 changes: 8 additions & 2 deletions packages/data-context/src/sources/ProjectDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ export class ProjectDataSource {
async isFirstTimeAccessing (projectRoot: string, testingType: 'e2e' | 'component') {
try {
const config = await this.ctx.file.readJsonFile<{ e2e?: object, component?: object }>(path.join(projectRoot, 'cypress.json'))
const type = testingType === 'e2e' ? 'e2e' : 'component'
const overrides = config[type] || {}

// If we have a cypress.json file, even with no overrides, assume that it's not our
// first time accessing (for now, until the config refactor lands)
if (testingType === 'e2e') {
return false
}

const overrides = config.component || {}

return Object.keys(overrides).length === 0
} catch (e) {
Expand Down
6 changes: 5 additions & 1 deletion packages/data-context/src/sources/WizardDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,14 @@ const LanguageNames: Record<WizardCodeLanguage, string> = {
}

export const wizardGetConfigCodeE2E = (opts: GetCodeOptsE2E): string | null => {
return `{
const exportStatement =
opts.lang === 'js' ? 'module.exports = {' : 'export default {'

return `${exportStatement}{
e2e: {
viewportHeight: 660,
viewportWidth: 1000,
}
}`
}

Expand Down