Skip to content

Commit a735739

Browse files
authored
fix: enable e2e tests for --bare (#674)
1 parent ad17806 commit a735739

File tree

9 files changed

+9
-10
lines changed

9 files changed

+9
-10
lines changed

.github/workflows/ci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ jobs:
167167

168168
- name: Run e2e test script
169169
working-directory: ./playground
170-
# bare templates can't pass e2e tests because their page structures don't match the example tests
171-
run: pnpm --filter '*${{ matrix.e2e-framework }}*' --filter '!*bare*' --workspace-concurrency 1 test:e2e
170+
run: pnpm --filter '*${{ matrix.e2e-framework }}*' --workspace-concurrency 1 test:e2e
172171

173172
# FIXME: Component testing is failing in CI after running too many tests.
174173
# The workaround in https://github.com/cypress-io/cypress/issues/22208 is not working.

template/bare/base/src/App.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup></script>
22

33
<template>
4-
<h1>Hello World</h1>
4+
<h1>You did it!</h1>
55
</template>
66

77
<style scoped></style>

template/bare/cypress-ct/src/__tests__/App.cy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import App from '../App.vue'
33
describe('App', () => {
44
it('mounts and renders properly', () => {
55
cy.mount(App)
6-
cy.get('h1').should('contain', 'Hello World')
6+
cy.get('h1').should('contain', 'You did it!')
77
})
88
})

template/bare/nightwatch-ct/src/__tests__/App.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('App', function () {
77
const appComponent = await browser.mountComponent('/src/App.vue');
88

99
browser.expect.element(appComponent).to.be.present;
10-
browser.expect.element('h1').text.to.contain('Hello World');
10+
browser.expect.element('h1').text.to.contain('You did it!');
1111
})
1212

1313
after((browser) => browser.end())

template/bare/typescript/src/App.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts"></script>
22

33
<template>
4-
<h1>Hello World</h1>
4+
<h1>You did it!</h1>
55
</template>
66

77
<style scoped></style>

template/bare/vitest/src/__tests__/App.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ import App from '../App.vue'
66
describe('App', () => {
77
it('mounts renders properly', () => {
88
const wrapper = mount(App)
9-
expect(wrapper.text()).toContain('Hello World')
9+
expect(wrapper.text()).toContain('You did it!')
1010
})
1111
})

template/config/nightwatch/tests/e2e/example.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ describe('My First Test', function () {
44
})
55

66
it('visits the app root url', function () {
7-
browser.assert.textContains('.green', 'You did it!')
7+
browser.assert.textContains('h1', 'You did it!')
88
})
99

1010
after((browser) => browser.end())

template/config/playwright/e2e/vue.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import { test, expect } from '@playwright/test';
44
// https://playwright.dev/docs/intro
55
test('visits the app root url', async ({ page }) => {
66
await page.goto('/');
7-
await expect(page.locator('div.greetings > h1')).toHaveText('You did it!');
7+
await expect(page.locator('h1')).toHaveText('You did it!');
88
})

template/config/playwright/e2e/vue.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import { test, expect } from '@playwright/test';
44
// https://playwright.dev/docs/intro
55
test('visits the app root url', async ({ page }) => {
66
await page.goto('/');
7-
await expect(page.locator('div.greetings > h1')).toHaveText('You did it!');
7+
await expect(page.locator('h1')).toHaveText('You did it!');
88
})

0 commit comments

Comments
 (0)