]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
fix: enable e2e tests for --bare (#674)
authorCédric Exbrayat <cexbrayat@users.noreply.github.com>
Thu, 30 Jan 2025 16:10:27 +0000 (17:10 +0100)
committerGitHub <noreply@github.com>
Thu, 30 Jan 2025 16:10:27 +0000 (00:10 +0800)
.github/workflows/ci.yml
template/bare/base/src/App.vue
template/bare/cypress-ct/src/__tests__/App.cy.js
template/bare/nightwatch-ct/src/__tests__/App.spec.js
template/bare/typescript/src/App.vue
template/bare/vitest/src/__tests__/App.spec.js
template/config/nightwatch/tests/e2e/example.js
template/config/playwright/e2e/vue.spec.js
template/config/playwright/e2e/vue.spec.ts

index 8deabed0d54fa36071e229b0227c2803f84fa45b..c1e4838f642df63dc2fda373258ef9c10007e73b 100644 (file)
@@ -167,8 +167,7 @@ jobs:
 
       - name: Run e2e test script
         working-directory: ./playground
-        # bare templates can't pass e2e tests because their page structures don't match the example tests
-        run: pnpm --filter '*${{ matrix.e2e-framework }}*' --filter '!*bare*' --workspace-concurrency 1 test:e2e
+        run: pnpm --filter '*${{ matrix.e2e-framework }}*' --workspace-concurrency 1 test:e2e
 
       # FIXME: Component testing is failing in CI after running too many tests.
       # The workaround in https://github.com/cypress-io/cypress/issues/22208 is not working.
index 6ca279f5d320c4b4bc61c5a27a6dffe02c54b582..d3d95dda3711698c7b92cb8f6f29b54080376bff 100644 (file)
@@ -1,7 +1,7 @@
 <script setup></script>
 
 <template>
-  <h1>Hello World</h1>
+  <h1>You did it!</h1>
 </template>
 
 <style scoped></style>
index 55f8caa1bd9b5023b1362ded665fdd45ab1fdc68..4933b141d7c476a03d6a06df65955aef4c713127 100644 (file)
@@ -3,6 +3,6 @@ import App from '../App.vue'
 describe('App', () => {
   it('mounts and renders properly', () => {
     cy.mount(App)
-    cy.get('h1').should('contain', 'Hello World')
+    cy.get('h1').should('contain', 'You did it!')
   })
 })
index 86cd9e122f1b06df8bfe984af1368d4bc5902d47..40cfb1d526d714d41e11dca3f892a493921bf67b 100644 (file)
@@ -7,7 +7,7 @@ describe('App', function () {
     const appComponent = await browser.mountComponent('/src/App.vue');
 
     browser.expect.element(appComponent).to.be.present;
-    browser.expect.element('h1').text.to.contain('Hello World');
+    browser.expect.element('h1').text.to.contain('You did it!');
   })
 
   after((browser) => browser.end())
index c2903a6225cb5be48b632349aa116423fbc84de1..9a8afec5f030adaeb0d2603dbb9f2f9ddaf49501 100644 (file)
@@ -1,7 +1,7 @@
 <script setup lang="ts"></script>
 
 <template>
-  <h1>Hello World</h1>
+  <h1>You did it!</h1>
 </template>
 
 <style scoped></style>
index 607fbfbab7351be9de80de7b5ed8f5940bcba6fc..5b17801eed036da81c6abc472bc42cef3a0b919a 100644 (file)
@@ -6,6 +6,6 @@ import App from '../App.vue'
 describe('App', () => {
   it('mounts renders properly', () => {
     const wrapper = mount(App)
-    expect(wrapper.text()).toContain('Hello World')
+    expect(wrapper.text()).toContain('You did it!')
   })
 })
index 43be3fce1c27a581300ee75ff7c0d459597af39f..05892c076b83f7ccbc9c9c0e544ae265885c5b8f 100644 (file)
@@ -4,7 +4,7 @@ describe('My First Test', function () {
   })
 
   it('visits the app root url', function () {
-    browser.assert.textContains('.green', 'You did it!')
+    browser.assert.textContains('h1', 'You did it!')
   })
 
   after((browser) => browser.end())
index 3e5a3d02d1a62bddec75ecc44cbcc739bd8b2151..fc116a962069f10848d63668b0a9a2bb2ce05e06 100644 (file)
@@ -4,5 +4,5 @@ import { test, expect } from '@playwright/test';
 // https://playwright.dev/docs/intro
 test('visits the app root url', async ({ page }) => {
   await page.goto('/');
-  await expect(page.locator('div.greetings > h1')).toHaveText('You did it!');
+  await expect(page.locator('h1')).toHaveText('You did it!');
 })
index 3e5a3d02d1a62bddec75ecc44cbcc739bd8b2151..fc116a962069f10848d63668b0a9a2bb2ce05e06 100644 (file)
@@ -4,5 +4,5 @@ import { test, expect } from '@playwright/test';
 // https://playwright.dev/docs/intro
 test('visits the app root url', async ({ page }) => {
   await page.goto('/');
-  await expect(page.locator('div.greetings > h1')).toHaveText('You did it!');
+  await expect(page.locator('h1')).toHaveText('You did it!');
 })