Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(webdriverio): make puppeteer a peer dependency #12103

Merged
merged 3 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 36 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/wdio-cucumber-framework/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ import {

DataTable,
World,
Status
Status,
} from '@cucumber/cucumber'
import Gherkin from '@cucumber/gherkin'
import { IdGenerator } from '@cucumber/messages'
import type { Feature, GherkinDocument } from '@cucumber/messages'
import type Cucumber from '@cucumber/cucumber'
import type { IRunEnvironment } from '@cucumber/cucumber/api'
import type { IConfiguration, IRunEnvironment } from '@cucumber/cucumber/api'
import { loadConfiguration, loadSources, runCucumber } from '@cucumber/cucumber/api'

import { DEFAULT_OPTS } from './constants.js'
Expand Down Expand Up @@ -269,7 +269,7 @@ class CucumberAdapter {
}

const { runConfiguration } = await loadConfiguration(
{ profiles: this._cucumberOpts.profiles, provided: this._cucumberOpts },
{ profiles: this._cucumberOpts.profiles, provided: this._cucumberOpts as Partial<IConfiguration> },
environment
)

Expand Down
2 changes: 1 addition & 1 deletion packages/wdio-cucumber-framework/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export interface CucumberOptions {
* "random" or "random:42" whereas 42 is the seed for randomization
* @default defined
*/
order?: string;
order?: 'defined' | 'random' | `random:${string}`;
/**
* Publish a report of your test run to https://reports.cucumber.io/
*/
Expand Down
26 changes: 13 additions & 13 deletions packages/wdio-cucumber-framework/tests/adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe('CucumberAdapter', () => {
it('can run without errors', async () => {
const adapter = await CucumberAdapter.init!('0-0', {
cucumberOpts: { format: [] }
}, ['/foo/bar'], {}, {}, {}, false, ['progress'])
}, ['/foo/bar'], {}, {}, {}, false, 'progress')
adapter.registerRequiredModules = vi.fn()
adapter.addWdioHooks = vi.fn()
adapter.loadFiles = vi.fn()
Expand Down Expand Up @@ -218,7 +218,7 @@ describe('CucumberAdapter', () => {
{},
{},
false,
['progress']
'progress'
)
adapter.addWdioHooks(
{
Expand Down Expand Up @@ -326,7 +326,7 @@ describe('CucumberAdapter', () => {
{},
{},
false,
['progress']
'progress'
)

expect(adapter._specs).toHaveLength(1)
Expand Down Expand Up @@ -354,7 +354,7 @@ describe('CucumberAdapter', () => {
{},
{},
false,
['progress']
'progress'
)

expect(adapter._specs).toHaveLength(1)
Expand Down Expand Up @@ -382,7 +382,7 @@ describe('CucumberAdapter', () => {
{},
{},
false,
['progress']
'progress'
)

expect(adapter._specs).toHaveLength(1)
Expand Down Expand Up @@ -410,7 +410,7 @@ describe('CucumberAdapter', () => {
{},
{},
false,
['progress']
'progress'
)

expect(adapter._specs).toHaveLength(1)
Expand Down Expand Up @@ -438,7 +438,7 @@ describe('CucumberAdapter', () => {
{},
{},
false,
['progress']
'progress'
)

expect(adapter._specs).toHaveLength(0)
Expand Down Expand Up @@ -466,7 +466,7 @@ describe('CucumberAdapter', () => {
{},
{},
false,
['progress']
'progress'
)

expect(adapter._specs).toHaveLength(1)
Expand Down Expand Up @@ -494,7 +494,7 @@ describe('CucumberAdapter', () => {
{},
{},
false,
['progress']
'progress'
)

expect(adapter._specs).toHaveLength(1)
Expand All @@ -521,7 +521,7 @@ describe('CucumberAdapter', () => {
{},
{},
false,
['progress']
'progress'
)

expect(adapter.gherkinParser.tokenMatcher.dialect.name).toBe('Danish')
Expand All @@ -539,7 +539,7 @@ describe('CucumberAdapter', () => {
{},
{},
false,
['progress']
'progress'
)

expect(adapter._specs).toHaveLength(2)
Expand Down Expand Up @@ -567,7 +567,7 @@ describe('CucumberAdapter', () => {
{},
{},
false,
['progress']
'progress'
)

expect(adapter._specs).toHaveLength(1)
Expand All @@ -594,7 +594,7 @@ describe('CucumberAdapter', () => {
{},
{},
true,
['progress']
'progress'
)

expect(adapter._specs).toHaveLength(0)
Expand Down