Skip to content

Commit 2ed2cd7

Browse files
committed
Test rerun feature enhancement
1 parent ad1ac35 commit 2ed2cd7

5 files changed

Lines changed: 20 additions & 9 deletions

File tree

packages/app/src/components/sidebar/constants.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ import type { RunCapabilities } from './types.js'
1010

1111
export const DEFAULT_CAPABILITIES: RunCapabilities = {
1212
canRunSuites: true,
13-
canRunTests: true
13+
canRunTests: true,
14+
canRunAll: true
1415
}
1516

1617
export const FRAMEWORK_CAPABILITIES: Record<string, RunCapabilities> = {
17-
cucumber: { canRunSuites: true, canRunTests: false },
18-
'nightwatch-cucumber': { canRunSuites: true, canRunTests: false }
18+
cucumber: { canRunSuites: true, canRunTests: false, canRunAll: true },
19+
'nightwatch-cucumber': { canRunSuites: true, canRunTests: false, canRunAll: false },
20+
nightwatch: { canRunSuites: true, canRunTests: true, canRunAll: false }
1921
}

packages/app/src/components/sidebar/explorer.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,16 +521,18 @@ export class DevtoolsSidebarExplorer extends CollapseableEntry {
521521
</h3>
522522
<nav class="flex ml-auto">
523523
<button
524-
class="p-1 rounded hover:bg-toolbarHoverBackground text-sm group"
524+
class="p-1 rounded text-sm group ${this.#getRunCapabilities().canRunAll ? 'hover:bg-toolbarHoverBackground' : 'opacity-30 cursor-not-allowed'}"
525+
?disabled=${!this.#getRunCapabilities().canRunAll}
525526
@click="${() => this.#runAllSuites()}"
526527
>
527-
<icon-mdi-play class="group-hover:text-chartsGreen"></icon-mdi-play>
528+
<icon-mdi-play class="${this.#getRunCapabilities().canRunAll ? 'group-hover:text-chartsGreen' : ''}"></icon-mdi-play>
528529
</button>
529530
<button
530-
class="p-1 rounded hover:bg-toolbarHoverBackground text-sm group"
531+
class="p-1 rounded text-sm group ${this.#getRunCapabilities().canRunAll ? 'hover:bg-toolbarHoverBackground' : 'opacity-30 cursor-not-allowed'}"
532+
?disabled=${!this.#getRunCapabilities().canRunAll}
531533
@click="${() => this.#stopActiveRun()}"
532534
>
533-
<icon-mdi-stop class="group-hover:text-chartsRed"></icon-mdi-stop>
535+
<icon-mdi-stop class="${this.#getRunCapabilities().canRunAll ? 'group-hover:text-chartsRed' : ''}"></icon-mdi-stop>
534536
</button>
535537
<button
536538
class="p-1 rounded hover:bg-toolbarHoverBackground text-sm group"

packages/app/src/components/sidebar/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export interface TestEntry {
1515
export interface RunCapabilities {
1616
canRunSuites: boolean
1717
canRunTests: boolean
18+
canRunAll: boolean
1819
}
1920

2021
export interface RunnerOptions {

packages/nightwatch-devtools/example/nightwatch.conf.cjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ module.exports = {
2222
desiredCapabilities: {
2323
browserName: 'chrome',
2424
'goog:chromeOptions': {
25-
args: ['--headless', '--no-sandbox', '--disable-dev-shm-usage', '--window-size=1600,1200']
25+
args: [
26+
'--headless',
27+
'--no-sandbox',
28+
'--disable-dev-shm-usage',
29+
'--window-size=1600,1200'
30+
]
2631
},
2732
'goog:loggingPrefs': { performance: 'ALL' }
2833
},

packages/nightwatch-devtools/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,8 @@ class NightwatchDevToolsPlugin {
917917
baseDir: process.cwd(),
918918
runCapabilities: {
919919
canRunSuites: true,
920-
canRunTests: !this.#isCucumberRunner
920+
canRunTests: !this.#isCucumberRunner,
921+
canRunAll: false
921922
}
922923
}
923924
}

0 commit comments

Comments
 (0)