File tree 10 files changed +107
-12
lines changed
10 files changed +107
-12
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,12 @@ name: Java
6
6
on :
7
7
push :
8
8
branches : [ main ]
9
+ paths :
10
+ - ' java/**'
9
11
pull_request :
10
12
branches : [ main ]
13
+ paths :
14
+ - ' java/**'
11
15
workflow_dispatch :
12
16
13
17
jobs :
Original file line number Diff line number Diff line change @@ -5,23 +5,43 @@ name: Python
5
5
6
6
on :
7
7
push :
8
- branches : [ main ]
8
+ branches :
9
+ - main
10
+ paths :
11
+ - ' python/**'
9
12
pull_request :
10
- branches : [ main ]
13
+ branches :
14
+ - main
15
+ paths :
16
+ - ' python/**'
11
17
12
18
jobs :
13
- build :
19
+ tests :
14
20
runs-on : ubuntu-latest
15
21
16
22
steps :
17
23
- uses : actions/checkout@v4
18
- - name : Set up Python 3.8
19
- uses : actions/setup-python @v2
24
+ - name : Set up Sauce Connect
25
+ uses : saucelabs/sauce-connect-action @v2
20
26
with :
21
- python-version : 3.8
27
+ username : ${{ secrets.SAUCE_USERNAME }}
28
+ accessKey : ${{ secrets.SAUCE_ACCESS_KEY }}
29
+ tunnelName : " sauce-bindings-${{ github.sha }}"
30
+ region : us-west
31
+ - name : Set up Python 3.12
32
+ uses : actions/setup-python@v5
33
+ with :
34
+ python-version : 3.12
22
35
- name : Test with pytest
23
36
env :
24
37
SAUCE_USERNAME : ${{ secrets.SAUCE_USERNAME }}
25
38
SAUCE_ACCESS_KEY : ${{ secrets.SAUCE_ACCESS_KEY }}
26
39
run : |
27
40
make python_tests
41
+
42
+ - name : Sauce Connect cleanup
43
+ uses : actions/upload-artifact@v3
44
+ if : ${{ failure() }}
45
+ with :
46
+ name : sauce-connect-log
47
+ path : ${{ env.SAUCE_CONNECT_DIR_IN_HOST }}/sauce-connect.log
Original file line number Diff line number Diff line change 1
- # This workflow will install Python dependencies, run tests and lint with a single version of Python
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3
-
4
1
name : Ruby
5
2
6
3
on :
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ class Configs:
7
7
'custom_data' : 'customData' ,
8
8
'public' : 'public' ,
9
9
'tunnel_identifier' : 'tunnelIdentifier' ,
10
+ 'tunnel_name' : 'tunnelName' ,
11
+ 'tunnel_owner' : 'tunnelOwner' ,
10
12
'parent_tunnel' : 'parentTunnel'
11
13
}
12
14
Original file line number Diff line number Diff line change 31
31
'iedriver_version' : 'iedriverVersion' ,
32
32
'max_duration' : 'maxDuration' ,
33
33
'name' : 'name' ,
34
+ # parent_tunnel is deprecated and being replaced with tunnel_owner.
34
35
'parent_tunnel' : 'parentTunnel' ,
35
36
'prerun' : 'prerun' ,
36
37
'priority' : 'priority' ,
42
43
'selenium_version' : 'seleniumVersion' ,
43
44
'tags' : 'tags' ,
44
45
'time_zone' : 'timeZone' ,
46
+ # tunnel_identifier is deprecated and being replaced with tunnel_name.
45
47
'tunnel_identifier' : 'tunnelIdentifier' ,
48
+ 'tunnel_name' : 'tunnelName' ,
49
+ 'tunnel_owner' : 'tunnelOwner' ,
46
50
'video_upload_on_pass' : 'videoUploadOnPass' ,
47
51
'capture_performance' : 'capturePerformance'
48
52
}
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ class TestCommonOptions(object):
6
6
7
7
def test_creates_session (self ):
8
8
# 1. Create SauceOptions instance with common w3c options
9
- sauceOptions = SauceOptions .firefox (browserVersion = '73.0 ' ,
10
- platformName = 'Windows 8 ' ,
9
+ sauceOptions = SauceOptions .firefox (browserVersion = '128 ' ,
10
+ platformName = 'Windows 11 ' ,
11
11
unhandledPromptBehavior = "ignore" )
12
12
13
13
# 2. Create Session object with SauceOptions object instance
Original file line number Diff line number Diff line change
1
+ import os
2
+
3
+ from saucebindings .options import SauceOptions
4
+ from saucebindings .session import SauceSession
5
+
6
+
7
+ class TestSauceOptions (object ):
8
+
9
+ def test_creates_session (self ):
10
+ # 1. Create a SauceOptions instance using tunnelName of a tunnel started earlier
11
+ tunnel_name = "sauce-bindings-{}" .format (os .environ .get ('GITHUB_SHA' ) or "test" )
12
+ sauceOptions = SauceOptions .chrome (extendedDebugging = True ,
13
+ idleTimeout = 45 ,
14
+ tunnelName = tunnel_name )
15
+
16
+ # 2. Create Session object with SauceOptions object instance
17
+ session = SauceSession (sauceOptions )
18
+
19
+ # 3. Start Session to get the Driver
20
+ driver = session .start ()
21
+
22
+ # 4. Use the driver in your tests just like normal
23
+ driver .get ('https://www.saucedemo.com/' )
24
+
25
+ # 5. Stop the Session with whether the test passed or failed
26
+ session .stop (True )
Original file line number Diff line number Diff line change @@ -117,6 +117,20 @@ def test_accepts_sauce_values_with_dict(self):
117
117
assert sauce .tunnel_identifier == 'foobar'
118
118
assert sauce .video_upload_on_pass is False
119
119
120
+ def test_accepts_tunnel (self ):
121
+ options = {'build' : 'bar' ,
122
+ 'idleTimeout' : 3 ,
123
+ 'name' : 'foo' ,
124
+ 'tunnelOwner' : 'bar' ,
125
+ 'tunnelName' : 'foobar' }
126
+
127
+ sauce = SauceOptions .chrome (** options )
128
+
129
+ assert sauce .build == 'bar'
130
+ assert sauce .name == 'foo'
131
+ assert sauce .tunnel_owner == 'bar'
132
+ assert sauce .tunnel_name == 'foobar'
133
+
120
134
def test_accepts_sauce_values_as_params (self ):
121
135
custom_data = {'foo' : 'foo' ,
122
136
'bar' : 'bar' }
Original file line number Diff line number Diff line change @@ -293,6 +293,20 @@ def test_sauce_options(self):
293
293
assert options .tunnel_identifier == 'tunnelname'
294
294
assert options .video_upload_on_pass is False
295
295
296
+ def test_accepts_tunnel (self ):
297
+ options = {'build' : 'bar' ,
298
+ 'idleTimeout' : 3 ,
299
+ 'name' : 'foo' ,
300
+ 'tunnelOwner' : 'bar' ,
301
+ 'tunnelName' : 'foobar' }
302
+
303
+ sauce = SauceOptions .edge (** options )
304
+
305
+ assert sauce .build == 'bar'
306
+ assert sauce .name == 'foo'
307
+ assert sauce .tunnel_owner == 'bar'
308
+ assert sauce .tunnel_name == 'foobar'
309
+
296
310
def test_setting_browser_name (self ):
297
311
options = SauceOptions .edge ()
298
312
Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ def test_setting_capabilities(self):
352
352
assert options .build == 'Sample Build Name'
353
353
assert options .command_timeout == 2
354
354
assert options .custom_data == custom_data
355
- assert options .extended_debugging == True
355
+ assert options .extended_debugging is True
356
356
assert options .idle_timeout == 3
357
357
assert options .geckodriver_version == '0.23'
358
358
assert options .max_duration == 300
@@ -487,3 +487,17 @@ def test_capabilities_for_selenium(self):
487
487
}
488
488
489
489
assert options .to_capabilities () == expected_capabilities
490
+
491
+ def test_accepts_tunnel (self ):
492
+ options = {'build' : 'bar' ,
493
+ 'idleTimeout' : 3 ,
494
+ 'name' : 'foo' ,
495
+ 'tunnelOwner' : 'bar' ,
496
+ 'tunnelName' : 'foobar' }
497
+
498
+ sauce = SauceOptions .firefox (** options )
499
+
500
+ assert sauce .build == 'bar'
501
+ assert sauce .name == 'foo'
502
+ assert sauce .tunnel_owner == 'bar'
503
+ assert sauce .tunnel_name == 'foobar'
You can’t perform that action at this time.
0 commit comments