@@ -33,75 +33,76 @@ export default class StorybookRunner extends LocalRunner {
33
33
async initialize ( ) {
34
34
log . info ( 'Adding the Visual Service' )
35
35
const { services } = this . #config
36
-
37
- if ( services ?. flat ( ) . includes ( 'visual' ) ) {
38
- log . info ( 'Visual Service is already added' )
39
- } else {
40
- this . #config. services = [
41
- ...( services ?? [ ] ) ,
42
- [
43
- 'visual' ,
44
- {
45
-
46
- }
47
- ] ,
48
- ]
49
- }
50
-
51
- log . info ( 'Start running Storybook tests' )
52
-
53
- const { storiesJson, storybookUrl, tempDir } = await scanStorybook ( this . #config, this . #options)
54
- // Set an environment variable so it can be used in the onComplete hook
55
- process . env . VISUAL_STORYBOOK_TEMP_SPEC_FOLDER = tempDir
56
- // Add the storybook URL to the environment variables
57
- process . env . VISUAL_STORYBOOK_URL = storybookUrl
58
-
59
- // Clear the capabilities
60
- this . #config. capabilities . length = 0
61
- log . info ( 'Clearing the current capabilities.' )
62
-
63
- // Determine some run options
64
- // --version
65
- const versionOption = this . #options?. version
66
- const versionArgv = getArgvValue ( '--version' , value => Math . floor ( parseFloat ( value ) ) )
67
- const version = versionOption ?? versionArgv ?? 7
68
- // --numShards
69
- const maxInstances = this . #config?. maxInstances ?? 1
70
- const numShardsOption = this . #options?. numShards
71
- const numShardsArgv = getArgvValue ( '--numShards' , value => parseInt ( value , 10 ) )
72
- const numShards = Math . min ( numShardsOption || numShardsArgv || NUM_SHARDS , maxInstances )
73
- // --clip
74
- const clipOption = this . #options?. clip
75
- const clipArgv = getArgvValue ( '--clip' , value => value !== 'false' )
76
- const clip = clipOption ?? clipArgv ?? true
77
- // --clipSelector
78
- const clipSelectorOption = this . #options?. clipSelector
79
- const clipSelectorArgv = getArgvValue ( '--clipSelector' , value => value )
80
- // V6 has '#root' as the root element, V7 has '#storybook-root'
81
- const clipSelector = ( clipSelectorOption ?? clipSelectorArgv ) ?? ( version === 6 ? V6_CLIP_SELECTOR : CLIP_SELECTOR )
82
- // Add the clip selector to the environment variables
83
- process . env . VISUAL_STORYBOOK_CLIP_SELECTOR = clipSelector
84
- // --skipStories
85
- const skipStoriesOption = this . #options?. skipStories
86
- const skipStoriesArgv = getArgvValue ( '--skipStories' , value => value )
87
- const skipStories = skipStoriesOption ?? skipStoriesArgv ?? [ ]
88
- const parsedSkipStories = parseSkipStories ( skipStories )
89
-
90
- // Create the test files
91
- createTestFiles ( {
92
- clip,
93
- clipSelector,
94
- directoryPath : tempDir ,
95
- folders : 'this.folders' , // Need to get the logic from the Visual service to here
96
- framework : this . #config. framework as string ,
97
- numShards,
98
- skipStories : parsedSkipStories ,
99
- storiesJson,
100
- storybookUrl,
101
- } )
102
-
103
- // Create the capabilities
104
- createStorybookCapabilities ( this . #config. capabilities as WebdriverIO . Capabilities [ ] )
36
+ console . log ( 'this.#config:' , this . #config)
37
+
38
+ // if (services?.flat().includes('visual')) {
39
+ // log.info('Visual Service is already added')
40
+ // } else {
41
+ // this.#config.services = [
42
+ // ...(services ?? []),
43
+ // [
44
+ // 'visual',
45
+ // {
46
+
47
+ // }
48
+ // ],
49
+ // ]
50
+ // }
51
+
52
+ // log.info('Start running Storybook tests')
53
+
54
+ // const { storiesJson, storybookUrl, tempDir } = await scanStorybook(this.#config, this.#options)
55
+ // // Set an environment variable so it can be used in the onComplete hook
56
+ // process.env.VISUAL_STORYBOOK_TEMP_SPEC_FOLDER = tempDir
57
+ // // Add the storybook URL to the environment variables
58
+ // process.env.VISUAL_STORYBOOK_URL = storybookUrl
59
+
60
+ // // Clear the capabilities
61
+ // this.#config.capabilities.length = 0
62
+ // log.info('Clearing the current capabilities.')
63
+
64
+ // // Determine some run options
65
+ // // --version
66
+ // const versionOption = this.#options?.version
67
+ // const versionArgv = getArgvValue('--version', value => Math.floor(parseFloat(value)))
68
+ // const version = versionOption ?? versionArgv ?? 7
69
+ // // --numShards
70
+ // const maxInstances = this.#config?.maxInstances ?? 1
71
+ // const numShardsOption = this.#options?.numShards
72
+ // const numShardsArgv = getArgvValue('--numShards', value => parseInt(value, 10))
73
+ // const numShards = Math.min(numShardsOption || numShardsArgv || NUM_SHARDS, maxInstances)
74
+ // // --clip
75
+ // const clipOption = this.#options?.clip
76
+ // const clipArgv = getArgvValue('--clip', value => value !== 'false')
77
+ // const clip = clipOption ?? clipArgv ?? true
78
+ // // --clipSelector
79
+ // const clipSelectorOption = this.#options?.clipSelector
80
+ // const clipSelectorArgv = getArgvValue('--clipSelector', value => value)
81
+ // // V6 has '#root' as the root element, V7 has '#storybook-root'
82
+ // const clipSelector = (clipSelectorOption ?? clipSelectorArgv) ?? (version === 6 ? V6_CLIP_SELECTOR : CLIP_SELECTOR)
83
+ // // Add the clip selector to the environment variables
84
+ // process.env.VISUAL_STORYBOOK_CLIP_SELECTOR = clipSelector
85
+ // // --skipStories
86
+ // const skipStoriesOption = this.#options?.skipStories
87
+ // const skipStoriesArgv = getArgvValue('--skipStories', value => value)
88
+ // const skipStories = skipStoriesOption ?? skipStoriesArgv ?? []
89
+ // const parsedSkipStories = parseSkipStories(skipStories)
90
+
91
+ // // Create the test files
92
+ // createTestFiles({
93
+ // clip,
94
+ // clipSelector,
95
+ // directoryPath: tempDir,
96
+ // folders: 'this.folders', // Need to get the logic from the Visual service to here
97
+ // framework: this.#config.framework as string,
98
+ // numShards,
99
+ // skipStories: parsedSkipStories,
100
+ // storiesJson,
101
+ // storybookUrl,
102
+ // })
103
+
104
+ // // Create the capabilities
105
+ // createStorybookCapabilities(this.#config.capabilities as WebdriverIO.Capabilities[])
105
106
106
107
// You end with this
107
108
await super . initialize ( )
0 commit comments