Skip to content

Commit dcb742f

Browse files
committed
Tab switch changes
1 parent 1d3b23a commit dcb742f

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

packages/app/src/components/workbench/source.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export class DevtoolsSource extends Element {
8181
#highlightCallSource (ev: CustomEvent<string>) {
8282
const [filePath, line] = ev.detail.split(':')
8383
this.#renderEditor(filePath, parseInt(line, 10))
84+
this.closest('wdio-devtools-tabs')?.activateTab('Source')
8485
}
8586

8687
render() {

packages/service/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const DEFAULT_LAUNCH_CAPS: WebdriverIO.Capabilities = {
88
browserName: 'chrome',
99
'goog:chromeOptions': {
1010
// production:
11-
args: ['--window-size=1200,800']
11+
args: ['--window-size=1600,1200']
1212
// development:
1313
// args: ['--window-size=1600,1200', '--auto-open-devtools-for-tabs']
1414
}

packages/service/src/reporter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import WebdriverIOReporter, { type SuiteStats, type TestStats } from '@wdio/reporter'
2-
import { enrichTestStats, setCurrentSpecFile, enrichSuiteStats } from './utils.js'
2+
import { mapTestToSource, setCurrentSpecFile, mapSuiteToSource } from './utils.js'
33

44
export class TestReporter extends WebdriverIOReporter {
55
#report: (data: any) => void
@@ -20,7 +20,7 @@ export class TestReporter extends WebdriverIOReporter {
2020
if (suiteStats.title) this.#suitePath.push(suiteStats.title)
2121

2222
// Enrich and set callSource for suites
23-
enrichSuiteStats(suiteStats as any, this.#currentSpecFile, this.#suitePath)
23+
mapSuiteToSource(suiteStats as any, this.#currentSpecFile, this.#suitePath)
2424
if ((suiteStats as any).file && (suiteStats as any).line != null) {
2525
;(suiteStats as any).callSource = `${(suiteStats as any).file}:${(suiteStats as any).line}`
2626
}
@@ -30,7 +30,7 @@ export class TestReporter extends WebdriverIOReporter {
3030

3131
onTestStart(testStats: TestStats): void {
3232
// Enrich testStats with callSource info
33-
enrichTestStats(testStats, this.#currentSpecFile)
33+
mapTestToSource(testStats, this.#currentSpecFile)
3434
if ((testStats as any).file && (testStats as any).line != null) {
3535
;(testStats as any).callSource = `${(testStats as any).file}:${(testStats as any).line}`
3636
}

packages/service/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ function findSuiteLocationByText(file: string, title: string) {
480480
* - Cucumber: prefer step-definition file/line
481481
* - Mocha/Jasmine: AST with suite path; fallback to runtime stack
482482
*/
483-
export function enrichTestStats(testStats: any, hintFile?: string) {
483+
export function mapTestToSource(testStats: any, hintFile?: string) {
484484
const title = String(testStats?.title ?? '').trim()
485485
const fullTitle = normalizeFullTitle(testStats?.fullTitle)
486486

@@ -549,7 +549,7 @@ export function enrichTestStats(testStats: any, hintFile?: string) {
549549
* - Mocha/Jasmine: map "describe/context" by title path using AST
550550
* - Cucumber: find Feature/Scenario line in .feature file
551551
*/
552-
export function enrichSuiteStats(
552+
export function mapSuiteToSource(
553553
suiteStats: any,
554554
hintFile?: string,
555555
suitePath: string[] = []

0 commit comments

Comments
 (0)