Vue API

Methods

mount

// Vue 3
import { mount } from 'cypress/vue'

// Vue 2
import { mount } from 'cypress/vue2'
Description Used for mounting Vue components in isolation. It is responsible for rendering the component within Cypress's sandboxed iframe and handling any framework-specific cleanup.
Signature mount(originalComponent: { new (...args: any[]): {}; __vccOpts: any; }, options?: MountOptions): Cypress.Chainable<VueWrapper>

Parameters

originalComponent
Description The component to mount in test
Type Vue Component
options
Description The options for mounting the component
Type MountOptions (optional)
Default undefined

Returns

A Cypress chainable of VueWrapper.

Interfaces

MountOptions

Union of StyleOptions & (Vue 3 MountingOptions or Vue 2 MountingOptions) from Vue Test Utils

StyleOptions

cssFile / cssFiles
Description Creates <style>...</style> element and inserts given CSS.
Type string (optional) | string[] (optional)
Default undefined
style / styles
Description Creates <style>...</style> element and inserts given CSS.
Type string (optional) | string[] (optional)
Default undefined
stylesheet / stylesheets
Description Creates <link href="..." /> element for each stylesheet
Type string (optional) | string[] (optional)
Default undefined