Closed
Description
Current behavior
We start our Cypress tests by using the Cypress module API. This has worked fine for us until the release Cypress 7 and its Component Test Runner. We don't know how to run the component tests from the API anymore.
Desired behavior
I expect to be able to write cypress.runCT({...})
in my JS script to run the component tests.
Versions
Cypress 7.2.0
Activity
jennifer-shehane commentedon May 3, 2021
Yeah, this is a good idea. We'll have to work through the specifics on what the API will look like to run component tests via the Module API.
[-]No API to run Component tests[/-][+]Allow component tests to be run via the module API[/+]JessicaSachs commentedon May 3, 2021
Hey @DamienCassou, thanks for the issue report! I proposed an API below. Looking for input before going ahead and scheduling this work. @brian-mann, any changes needed here?
Motivation
Passing
testingMode
within the Cypress module API's options would allow the user to swap betweencypress run
andcypress run-ct
from within node.Proposed API
We'll do an options-object approach and pass that through to run/open. Since 7.x we have the concept of
testingType
.Cypress's module API is options-based, so we should continue that pattern and add another property to the options object. The property
testingType
is already used within Cypress internally and exposed on the Cypress config object. Currently, testingType's main use is within the plugins file to support users that run both CT + E2E. It allows users to swap between Component-only plugins and E2E-only plugins. I think it makes sense to use it within the Cypress module API as well.We would extend the existing options defined in the module API docs with the following:
Property:
testingType
Valid values:
e2e
,component
Default:
e2e
9 remaining items