Skip to content

Commit 395328b

Browse files
committed
lots of suite stabilizations
1 parent 277068b commit 395328b

File tree

22 files changed

+320
-145
lines changed

22 files changed

+320
-145
lines changed

packages/selenium-ide/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selenium-ide",
3-
"version": "4.0.1-alpha.97",
3+
"version": "4.0.1-alpha.98",
44
"private": false,
55
"description": "Selenium IDE electron app",
66
"author": "Todd <tarsitodd@gmail.com>",
@@ -122,9 +122,9 @@
122122
"@seleniumhq/code-export-ruby-rspec": "^4.0.0-alpha.6",
123123
"@seleniumhq/get-driver": "^4.0.0-alpha.3",
124124
"@seleniumhq/side-api": "^4.0.0-alpha.49",
125-
"@seleniumhq/side-commons": "^4.0.0-alpha.2",
125+
"@seleniumhq/side-commons": "^4.0.0-alpha.3",
126126
"@seleniumhq/side-model": "^4.0.0-alpha.5",
127-
"@seleniumhq/side-runtime": "^4.0.0-alpha.43",
127+
"@seleniumhq/side-runtime": "^4.0.0-alpha.44",
128128
"dnd-core": "^16.0.1",
129129
"electron-chromedriver": "^28.0.0",
130130
"electron-log": "^5.1.0",

packages/selenium-ide/src/browser/components/ProjectEditor/index.tsx

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,25 @@ const ProjectEditor: React.FC<
2424
<SIDEAppBar session={session} setTab={setTab} tab={tab} />
2525
</div>
2626
<div className="flex-1">
27-
{showDrawer && (
28-
<PanelGroup
29-
direction="horizontal"
30-
id="drawer-editor"
31-
{...usePanelGroup('drawer-editor')}
32-
>
33-
<Panel collapsible id="editor-drawer" order={1}>
34-
<SIDEDrawer session={session} tab={tab} />
35-
</Panel>
36-
<PanelResizeHandle className="resize-bar" id="h-resize-1" />
37-
<Panel id="editor-panel" order={2}>
38-
<Box className="fill flex flex-col">
39-
<Main session={session} setTab={setTab} tab={tab} />
40-
</Box>
41-
</Panel>
42-
</PanelGroup>
43-
)}
44-
{!showDrawer && (
45-
<Box className="fill flex flex-col">
46-
<Main session={session} setTab={setTab} tab={tab} />
47-
</Box>
48-
)}
27+
<PanelGroup
28+
direction="horizontal"
29+
id="drawer-editor"
30+
{...usePanelGroup('drawer-editor', !showDrawer)}
31+
>
32+
{showDrawer && (
33+
<>
34+
<Panel collapsible id="editor-drawer" defaultSize={25} order={1}>
35+
<SIDEDrawer session={session} tab={tab} />
36+
</Panel>
37+
<PanelResizeHandle className="resize-bar" id="h-resize-1" />
38+
</>
39+
)}
40+
<Panel defaultSize={75} id="editor-panel" order={2}>
41+
<Box className="fill flex flex-col">
42+
<Main session={session} setTab={setTab} tab={tab} />
43+
</Box>
44+
</Panel>
45+
</PanelGroup>
4946
</div>
5047
</div>
5148
</DndProvider>
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import React from 'react'
22
import { ImperativePanelGroupHandle } from 'react-resizable-panels'
33

4-
export const usePanelGroup = (id: string) => {
4+
export const usePanelGroup = (id: string, disabled = false) => {
55
const [ready, setReady] = React.useState(false)
66
const ref = React.useRef<null | ImperativePanelGroupHandle>(null)
77
React.useEffect(() => {
8+
if (disabled) {
9+
return setReady(false)
10+
}
811
if (!ref.current) return
912
window.sideAPI.resizablePanels.getPanelGroup(id).then((values) => {
1013
ref.current?.setLayout(values)
1114
setReady(true)
1215
})
13-
}, [ref])
16+
}, [disabled, ref])
1417
const onLayout = React.useCallback(
1518
(sizes: number[]) => {
1619
if (!ready) return
@@ -20,6 +23,7 @@ export const usePanelGroup = (id: string) => {
2023
)
2124
return {
2225
ref,
26+
reset: () => setReady(false),
2327
onLayout,
2428
}
2529
}

packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Project/ProjectTab.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { SIDEMainProps } from 'browser/components/types'
44
import React, { FC } from 'react'
55
import ProjectSettings from './ProjectSettings'
66
import SystemSettings from './SystemSettings'
7+
import SettingsTabs from './SettingTabs'
78

89
export interface MiniProjectShape {
910
id: string
@@ -23,6 +24,7 @@ const ProjectTab: React.FC<
2324
Pick<SIDEMainProps, 'session' | 'setTab' | 'tab'>
2425
> = ({ session }) => (
2526
<Box className="fill flex flex-col">
27+
{!session.state.editor.showDrawer && <SettingsTabs session={session} />}
2628
<Paper elevation={1} id="project-editor" square>
2729
<SettingsWrapper session={session} />
2830
</Paper>

packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Suites/SuitesTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const SuitesTab: React.FC<
1313

1414
return (
1515
<Box className="fill flex flex-col">
16-
<SuiteSelector session={session} />
16+
{!session.state.editor.showDrawer && <SuiteSelector session={session} />}
1717
<Component session={session} />
1818
</Box>
1919
)

packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Tests/TestCommandListItem.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ const CommandRow: React.FC<CommandRowProps> = ({
123123
}
124124
secondary={
125125
<>
126-
<Box sx={errorTextFormat}>{commandState.message}</Box>
127126
{comment && (
128127
<Box sx={commentTextFormat}>// {comment}</Box>
129128
)}

packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Tests/TestsTab.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import CommandTable from './TestCommandTable'
1212
import { loadingID } from '@seleniumhq/side-api/dist/constants/loadingID'
1313
import MainHeader from 'browser/components/Main/Header'
1414
import { SIDEMainProps } from 'browser/components/types'
15+
import TestSelector from './TestSelector'
1516

1617
const sxCenter = { textAlign: 'center' }
1718
const NoTestFound = () => (
@@ -79,6 +80,7 @@ const TestsTab: React.FC<Pick<SIDEMainProps, 'session' | 'setTab' | 'tab'>> = ({
7980
const disabled = ['playing', 'recording'].includes(session.state.status)
8081
return (
8182
<Box className="fill flex flex-col" ref={ref}>
83+
{!session.state.editor.showDrawer && (<TestSelector session={session} />)}
8284
{activeTestID === loadingID ? (
8385
<NoTestFound />
8486
) : (

packages/selenium-ide/src/main/session/controllers/Driver/index.ts

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import startDriver, { port, WebdriverDebugLog } from './start'
1010
import BaseController from '../Base'
1111
import { createBidiAPIBindings } from './bidi'
1212
import { CommandShape } from '@seleniumhq/side-model'
13+
import { absolutifyUrl } from '@seleniumhq/side-runtime/src/utils'
14+
import { retry } from '@seleniumhq/side-commons'
1315

1416
// Escape hatch to avoid dealing with rootDir complexities in TS
1517
// https://stackoverflow.com/questions/50822310/how-to-import-package-json-in-typescript
@@ -152,15 +154,38 @@ const electronPolyfills = (
152154
name: 'dismissPrompt',
153155
description: 'Dismisses a prompt',
154156
},
157+
open: {
158+
execute: async (command: CommandShape, executor: WebDriverExecutor) => {
159+
const url = command.target
160+
const handle = await executor.driver.getWindowHandle()
161+
const window = await session.windows.getPlaybackWindowByHandle(handle)
162+
if (!window) {
163+
throw new Error('Failed to find playback window')
164+
}
165+
await retry(
166+
() => window.loadURL(absolutifyUrl(url!, session.projects.project.url)),
167+
5,
168+
100
169+
)
170+
},
171+
name: 'doOpen',
172+
description: 'Opens a URL',
173+
},
155174
setWindowSize: {
156175
execute: async (command: CommandShape, executor: WebDriverExecutor) => {
157176
const handle = await executor.driver.getWindowHandle()
158177
const window = await session.windows.getPlaybackWindowByHandle(handle)
159178
if (!window) {
160179
throw new Error('Failed to find playback window')
161180
}
162-
const [targetWidth, targetHeight] = command.target!.split('x').map((v) => parseInt(v))
163-
await session.windows.resizePlaybackWindow(window, targetWidth, targetHeight)
181+
const [targetWidth, targetHeight] = command
182+
.target!.split('x')
183+
.map((v) => parseInt(v))
184+
await session.windows.resizePlaybackWindow(
185+
window,
186+
targetWidth,
187+
targetHeight
188+
)
164189
},
165190
name: 'setWindowSize',
166191
description: 'Sets the playback window size',
@@ -213,7 +238,15 @@ export default class DriverController extends BaseController {
213238
.usingServer(server)
214239
.forBrowser(browserName)
215240
console.info('Building driver for ' + browser)
216-
const driver = await driverBuilder.build()
241+
const driver = await retry(
242+
async () => {
243+
const result = await driverBuilder.build()
244+
console.info('Built driver for ' + browser)
245+
return result
246+
},
247+
3,
248+
100
249+
)
217250
console.info('Built driver for ' + browser)
218251
const useBidi = await this.session.store.get('browserInfo.useBidi')
219252
if (useBidi) {

0 commit comments

Comments
 (0)