Skip to content

Commit

Permalink
ci: deliver vue3 on master (#16728)
Browse files Browse the repository at this point in the history
* feat(vue): vue 3 support in @cypress/vue

BREAKING CHANGE: no support for vue 2 anymore

* build: disable auto deliver of next vue

* Revert "feat(vue): vue 3 support in @cypress/vue"

This reverts commit 8f55d7b.

* Revert "build: disable auto deliver of next vue"

This reverts commit ed46c9e.

* chore: release @cypress/vue-v1.1.0-alpha.1

[skip ci]

* feat: vue3 support for @cypress/vue (#15100)

* feat: add support for vue3 in npm/vue

BREAKING CHANGE: dropped support for vue 2 in favor of vue 3

* test: remove filter tests not relevant in vue 3

* build: try publishing as a private new major

* chore: release @cypress/vue-v3.0.0-alpha.1

[skip ci]

* chore: bring back access public

* fix: update dependency to webpack dev server

* chore: release @cypress/vue-v3.0.0-alpha.2

[skip ci]

* chore: remove unnecessary dependency

* fix: mistreatment of monorepo dependency

* chore: release @cypress/vue-v3.0.0-alpha.3

[skip ci]

* chore: release @cypress/vue-v3.0.0-alpha.4

[skip ci]

* fix: use __cy_root at the root element

* build: avoid using array spread (tslib imports issue)

* fix: setup for cypress vue tests

* fix: add cleanup event

* test: make sure we use the right build of compiler

* chore: downgrade VTU to rc-1

* chore: release @cypress/vue-v3.0.0

[skip ci]

* chore: upgrade vue version to 3.0.11

* fix: adjust optional peer deps

* fix: allow fo any VTU 2 version using ^

* test: ignore nuxt example

* test: update yarn lock on vue cli

* chore: release @cypress/vue-v3.0.1

[skip ci]

* ci: release vue@next on master

* test: fix vue3 examples

* ci: open only needed server in circle npm-vue

Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
  • Loading branch information
3 people authored May 31, 2021
1 parent c618d30 commit 0ee001f
Show file tree
Hide file tree
Showing 60 changed files with 621 additions and 9,519 deletions.
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ jobs:
npm-vue:
<<: *defaults
resource_class: medium
parallelism: 4
parallelism: 3
steps:
- restore_cached_workspace
- run:
Expand Down
2 changes: 1 addition & 1 deletion npm/vite-dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"@cypress/react": "0.0.0-development",
"@cypress/vue": "3.0.1",
"@cypress/vue": "0.0.0-development",
"@testing-library/cypress": "7.0.4",
"@vitejs/plugin-vue": "1.2.0",
"@vue/compiler-sfc": "3.0.9",
Expand Down
4 changes: 2 additions & 2 deletions npm/vue/.releaserc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
...require('../../.releaserc.base'),
branches: [
{ name: 'master' },
{ name: 'next/npm/vue', channel: 'next', prerelease: 'alpha' },
{ name: 'next/npm/vue2' },
{ name: 'master', channel: 'next', prerelease: 'beta' },
],
}
79 changes: 74 additions & 5 deletions npm/vue/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,91 @@
# [@cypress/vue-v2.2.3](https://github.com/cypress-io/cypress/compare/@cypress/vue-v2.2.2...@cypress/vue-v2.2.3) (2021-05-11)
# [@cypress/vue-v3.0.1](https://github.com/cypress-io/cypress/compare/@cypress/vue-v3.0.0...@cypress/vue-v3.0.1) (2021-04-08)

### Bug Fixes

* adjust optional peer deps ([735d61d](https://github.com/cypress-io/cypress/commit/735d61d15a34c04729bff692861faad2dc1b6a35))
* allow fo any VTU 2 version using ^ ([a1da052](https://github.com/cypress-io/cypress/commit/a1da0520651eaa1d83db96fe9d692b28ad2fc727))

# [@cypress/vue-v3.0.0](https://github.com/cypress-io/cypress/compare/@cypress/vue-v2.2.0...@cypress/vue-v3.0.0) (2021-04-07)


### Bug Fixes

* accept webapck 4 & 5 as peer dependencies of @cypress/vue and @cypress/react ([#16290](https://github.com/cypress-io/cypress/issues/16290)) ([c4151fb](https://github.com/cypress-io/cypress/commit/c4151fbd9f3c10de28e3e8dd3a75d0e0973b52e2))
* add cleanup event ([cf51935](https://github.com/cypress-io/cypress/commit/cf51935bf5a49594b012e9a6bd9cabe983fbe500))
* mistreatment of monorepo dependency ([a21afb2](https://github.com/cypress-io/cypress/commit/a21afb2f2204debd191586bcb250bb64ecbdfd25))
* setup for cypress vue tests ([c27dc77](https://github.com/cypress-io/cypress/commit/c27dc77ecdb9b33c68737db690432e0418181286))
* update dependency to webpack dev server ([717ea3a](https://github.com/cypress-io/cypress/commit/717ea3a628c26743a9fe8868e01291ad6b8c0977))
* use __cy_root at the root element ([9cf102a](https://github.com/cypress-io/cypress/commit/9cf102ad6248a90a91ca766e2ff9267db0f208fa))

# [@cypress/vue-v2.2.2](https://github.com/cypress-io/cypress/compare/@cypress/vue-v2.2.1...@cypress/vue-v2.2.2) (2021-05-05)

### Features

* vue3 support for @cypress/vue ([#15100](https://github.com/cypress-io/cypress/issues/15100)) ([71e85a0](https://github.com/cypress-io/cypress/commit/71e85a03682d577344e705548b5350ec84c29382))


### Reverts

* Revert "feat(vue): vue 3 support in @cypress/vue" ([53fc995](https://github.com/cypress-io/cypress/commit/53fc9958d111a8e60c6dcd873c9d89666c86dfc8))


### BREAKING CHANGES

* dropped support for vue 2 in favor of vue 3

* test: remove filter tests not relevant in vue 3

# [@cypress/vue-v3.0.0-alpha.4](https://github.com/cypress-io/cypress/compare/@cypress/vue-v3.0.0-alpha.3...@cypress/vue-v3.0.0-alpha.4) (2021-03-10)


### Bug Fixes

* accept webapck 4 & 5 as peer dependencies of @cypress/vue and @cypress/react ([#16290](https://github.com/cypress-io/cypress/issues/16290)) ([500cab9](https://github.com/cypress-io/cypress/commit/500cab95ef7a7d6b74b366ba8066bcf73f2955aa))
* **component-testing:** video recording for single browser session mode ([#15328](https://github.com/cypress-io/cypress/issues/15328)) ([cce08d2](https://github.com/cypress-io/cypress/commit/cce08d23b781b219635d43419e5b6177927e1ba5))

# [@cypress/vue-v2.2.1](https://github.com/cypress-io/cypress/compare/@cypress/vue-v2.2.0...@cypress/vue-v2.2.1) (2021-04-21)
# [@cypress/vue-v3.0.0-alpha.3](https://github.com/cypress-io/cypress/compare/@cypress/vue-v3.0.0-alpha.2...@cypress/vue-v3.0.0-alpha.3) (2021-02-24)


### Bug Fixes

* mistreatment of monorepo dependency ([a21afb2](https://github.com/cypress-io/cypress/commit/a21afb2f2204debd191586bcb250bb64ecbdfd25))

# [@cypress/vue-v3.0.0-alpha.2](https://github.com/cypress-io/cypress/compare/@cypress/vue-v3.0.0-alpha.1...@cypress/vue-v3.0.0-alpha.2) (2021-02-24)


### Bug Fixes

* make webpack-dev-server a peer dependency ([#15163](https://github.com/cypress-io/cypress/issues/15163)) ([fa969fb](https://github.com/cypress-io/cypress/commit/fa969fba78d86494b5d920f573768677301fad13))
* update dependency to webpack dev server ([717ea3a](https://github.com/cypress-io/cypress/commit/717ea3a628c26743a9fe8868e01291ad6b8c0977))

# [@cypress/vue-v3.0.0-alpha.1](https://github.com/cypress-io/cypress/compare/@cypress/vue-v2.0.1...@cypress/vue-v3.0.0-alpha.1) (2021-02-18)


### Features

* vue3 support for @cypress/vue ([#15100](https://github.com/cypress-io/cypress/issues/15100)) ([71e85a0](https://github.com/cypress-io/cypress/commit/71e85a03682d577344e705548b5350ec84c29382))


### Reverts

* Revert "feat(vue): vue 3 support in @cypress/vue" ([53fc995](https://github.com/cypress-io/cypress/commit/53fc9958d111a8e60c6dcd873c9d89666c86dfc8))


### BREAKING CHANGES

* dropped support for vue 2 in favor of vue 3

* test: remove filter tests not relevant in vue 3

# [@cypress/vue-v2.2.3](https://github.com/cypress-io/cypress/compare/@cypress/vue-v2.2.2...@cypress/vue-v2.2.3) (2021-05-11)

### Bug Fixes

* accept webapck 4 & 5 as peer dependencies of @cypress/vue and @cypress/react ([#16290](https://github.com/cypress-io/cypress/issues/16290)) ([c4151fb](https://github.com/cypress-io/cypress/commit/c4151fbd9f3c10de28e3e8dd3a75d0e0973b52e2))

# [@cypress/vue-v2.2.2](https://github.com/cypress-io/cypress/compare/@cypress/vue-v2.2.1...@cypress/vue-v2.2.2) (2021-05-05)

* accept webapck 4 & 5 as peer dependencies of @cypress/vue and @cypress/react ([#16290](https://github.com/cypress-io/cypress/issues/16290)) ([500cab9](https://github.com/cypress-io/cypress/commit/500cab95ef7a7d6b74b366ba8066bcf73f2955aa))

# [@cypress/vue-v2.2.1](https://github.com/cypress-io/cypress/compare/@cypress/vue-v2.2.0...@cypress/vue-v2.2.1) (2021-04-21)

* improve handling of userland injected styles in component testing ([#16024](https://github.com/cypress-io/cypress/issues/16024)) ([fe0b63c](https://github.com/cypress-io/cypress/commit/fe0b63c299947470c9cdce3a0d00364a1e224bdb))

# [@cypress/vue-v2.2.0](https://github.com/cypress-io/cypress/compare/@cypress/vue-v2.1.1...@cypress/vue-v2.2.0) (2021-04-05)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ describe('Message', () => {
cy.wrap(Cypress).its('vue.message').should('equal', 'hey')
})

it('has no cat property', () => {
createCmp({ cat: 'hey', message: 'hey' })
cy.wrap(Cypress).its('vue').should('not.have.property', 'cat')
})

it('Paco is the default author', () => {
createCmp({ message: 'hey' })
cy.wrap(Cypress).its('vue.author').should('equal', 'Paco')
Expand Down Expand Up @@ -65,14 +60,10 @@ describe('Message', () => {

it('triggers a message-clicked event clicked', () => {
createCmp({ message: 'Cat' }).then(() => {
const stub = cy.spy()

Cypress.vue.$on('message-clicked', stub)
cy.get('.message')
.click()
.then(() => {
expect(stub).to.be.calledOnce
expect(stub).to.be.calledWith('Cat')
expect(Cypress.vueWrapper.emitted()).to.have.property('message-clicked')
})
})
})
Expand Down
13 changes: 5 additions & 8 deletions npm/vue/cypress/component/advanced/i18n/spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/// <reference types="cypress" />
import Vue from 'vue'
import TranslatedMessageWithJSON from './TranslatedJSONMessage.vue'
import TranslatedMessageI18nBlock from './TranslatedI18nMessage.vue'
import VueI18n from 'vue-i18n'
import { createI18n } from 'vue-i18n'
import { mount } from '@cypress/vue'
import messages from './translations.json'

Expand All @@ -22,23 +21,21 @@ function expectHelloWorldGreeting () {
}

describe('VueI18n', () => {
Vue.use(VueI18n)

describe('with i18n block', () => {
beforeEach(() => {
const i18n = new VueI18n({ locale: 'en' })
const i18n = createI18n({ locale: 'en' })

mount(TranslatedMessageI18nBlock, { i18n })
mount(TranslatedMessageI18nBlock, { global: { plugins: [i18n] } })
})

it('shows HelloWorld for all locales', expectHelloWorldGreeting)
})

describe('with messages argument', () => {
beforeEach(() => {
const i18n = new VueI18n({ locale: 'en', messages })
const i18n = createI18n({ locale: 'en', messages })

mount(TranslatedMessageWithJSON, { i18n })
mount(TranslatedMessageWithJSON, { global: { plugins: [i18n] } })
})

it('shows HelloWorld for all locales', expectHelloWorldGreeting)
Expand Down
20 changes: 11 additions & 9 deletions npm/vue/cypress/component/advanced/render-functions/spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="cypress" />
import { mount } from '@cypress/vue'
import { h as createElement } from 'vue'

describe('Single render function component', () => {
// the component definition
Expand Down Expand Up @@ -118,18 +119,19 @@ describe('Component with slot', () => {
describe('Component with arguments', () => {
// the component definition
const appComponent = {
render (createElement) {
render () {
let a = this.elementtype.split(',')

return createElement(
a[0],
{
attrs: {
id: a[3],
style: `color:${a[1]};font-size:${a[2]};`,
id: a[3],
style: {
color: a[1],
'font-size': `${a[2]}pt`,
},
},
this.$slots.default || '<EMPTY>',
this.$slots.default ? this.$slots.default() : '<EMPTY>',
)
},
props: {
Expand All @@ -144,7 +146,7 @@ describe('Component with arguments', () => {
// we want to use custom app component above
extensions: {
components: {
'app-component': appComponent,
appComponent,
},
},
}
Expand All @@ -168,13 +170,13 @@ describe('Component with arguments', () => {
cy.contains('h3', 'Hello Peter').should(
'have.attr',
'style',
'color:red;font-size:30;',
'color: red; font-size: 30pt;',
)

cy.contains('p', 'Hello John').should(
'have.attr',
'style',
'color:green;font-size:30;',
'color: green; font-size: 30pt;',
)
})

Expand All @@ -189,7 +191,7 @@ describe('Component with arguments', () => {
cy.contains('<EMPTY>').should(
'have.attr',
'style',
'color:red;font-size:30;',
'color: red; font-size: 30pt;',
)
})
})
13 changes: 0 additions & 13 deletions npm/vue/cypress/component/basic/filters/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions npm/vue/cypress/component/basic/filters/reverse.js

This file was deleted.

35 changes: 0 additions & 35 deletions npm/vue/cypress/component/basic/filters/spec.js

This file was deleted.

4 changes: 0 additions & 4 deletions npm/vue/cypress/component/basic/options-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,4 @@ describe('Mount component', () => {
it('shows hello', () => {
cy.contains('Hello Vue!')
})

it('has version', () => {
cy.window().its('Vue.version').should('be.a', 'string')
})
})
4 changes: 2 additions & 2 deletions npm/vue/cypress/component/basic/plugins/MyPlugin.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// https://vuejs.org/v2/guide/plugins.html
// https://alligator.io/vuejs/creating-custom-plugins/
export const MyPlugin = {
install (Vue) {
install (app) {
// 1. add global method or property
Vue.aPluginMethod = function () {
app.config.globalProperties.aPluginMethod = function () {
return 'foo'
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// https://vuejs.org/v2/guide/plugins.html
// https://alligator.io/vuejs/creating-custom-plugins/
export const MyPluginWithOptions = {
install (Vue, options) {
install (app, options) {
if (!options) {
throw new Error('MyPlugin is missing options!')
}

// this method uses options argument
Vue.anotherPluginMethod = function () {
app.config.globalProperties.anotherPluginMethod = function () {
return options.label
}
},
Expand Down
11 changes: 5 additions & 6 deletions npm/vue/cypress/component/basic/plugins/plugin-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Single component mount', () => {

mount(EmptyComponent, { extensions })

cy.window().its('Vue').invoke('aPluginMethod').should('equal', 'foo')
cy.wrap(Cypress).its('vue').invoke('aPluginMethod').should('equal', 'foo')
})
})

Expand All @@ -32,11 +32,11 @@ describe('Custom plugin MyPlugin', () => {
beforeEach(mountCallback(EmptyComponent, { extensions }))

it('registers global method on Vue instance', () => {
cy.window().its('Vue').its('aPluginMethod').should('be.a', 'function')
cy.wrap(Cypress).its('vue').its('aPluginMethod').should('be.a', 'function')
})

it('can call this global function', () => {
cy.window().its('Vue').invoke('aPluginMethod').should('equal', 'foo')
cy.wrap(Cypress).its('vue').invoke('aPluginMethod').should('equal', 'foo')
})
})

Expand All @@ -55,10 +55,9 @@ describe('Plugins with options', () => {
mount(EmptyComponent, { extensions })

// first plugin works
cy.window().its('Vue').invoke('aPluginMethod').should('equal', 'foo')
cy.wrap(Cypress).its('vue').invoke('aPluginMethod').should('equal', 'foo')
// second plugin works
cy.window()
.its('Vue')
cy.wrap(Cypress).its('vue')
.invoke('anotherPluginMethod')
.should('equal', 'testing')
})
Expand Down
Loading

0 comments on commit 0ee001f

Please sign in to comment.