Skip to content

Commit 2086f38

Browse files
committed
[rb] implement chromium launch app functionality
1 parent 8aa962d commit 2086f38

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

rb/lib/selenium/webdriver/chrome/driver.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class Driver < WebDriver::Driver
3232
DriverExtensions::HasNetworkConditions,
3333
DriverExtensions::HasNetworkInterception,
3434
DriverExtensions::HasWebStorage,
35+
DriverExtensions::HasLaunching,
3536
DriverExtensions::HasLocation,
3637
DriverExtensions::DownloadsFiles,
3738
DriverExtensions::HasDevTools,

rb/lib/selenium/webdriver/chrome/features.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module Chrome
2323
module Features
2424

2525
CHROME_COMMANDS = {
26+
launch_app: [:post, 'session/:session_id/chromium/launch_app'],
2627
get_cast_sinks: [:get, 'session/:session_id/goog/cast/get_sinks'],
2728
set_cast_sink_to_use: [:post, 'session/:session_id/goog/cast/set_sink_to_use'],
2829
start_cast_tab_mirroring: [:post, 'session/:session_id/goog/cast/start_tab_mirroring'],
@@ -39,6 +40,10 @@ def commands(command)
3940
CHROME_COMMANDS[command] || self.class::COMMANDS[command]
4041
end
4142

43+
def launch_app(id)
44+
execute :launch_app, {}, {id: id}
45+
end
46+
4247
def cast_sinks
4348
execute :get_cast_sinks
4449
end

rb/lib/selenium/webdriver/common.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
require 'selenium/webdriver/common/driver_extensions/has_pinned_scripts'
7272
require 'selenium/webdriver/common/driver_extensions/has_cdp'
7373
require 'selenium/webdriver/common/driver_extensions/has_casting'
74+
require 'selenium/webdriver/common/driver_extensions/has_launching'
7475
require 'selenium/webdriver/common/keys'
7576
require 'selenium/webdriver/common/profile_helper'
7677
require 'selenium/webdriver/common/options'
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed to the Software Freedom Conservancy (SFC) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The SFC licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
module Selenium
21+
module WebDriver
22+
module DriverExtensions
23+
module HasLaunching
24+
25+
def launch_app(id)
26+
@bridge.launch_app(id)
27+
end
28+
29+
end # HasLaunching
30+
end # DriverExtensions
31+
end # WebDriver
32+
end # Selenium

0 commit comments

Comments
 (0)