Repository: saucelabs/sauce_bindings (language: python)

Issue:
Add Latest OS Options 
It looks like the `SauceBindings` has not been updated with Windows 11 or macOS Monterey, could those be added as options as they are supported by SauceLabs now?


Discussion / hints:
@jjathman for sure! 
@titusfortner I wonder if we should add an overloaded method to allow users to pass in a string version of OS as a backup? This way if we are behind the ball on adding an enum, the users can at least use the string version?
Or maybe, we make the addition of these capabilities easy such as putting it into a config and then users can create a quick PR to update it?

Fix patch:
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index 110aa495..eff257ab 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -1,17 +1,16 @@
 # This workflow will install Python dependencies, run tests and lint with a single version of Python
 # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
 
-name: Python application
+name: Python
 
 on:
   push:
-    branches: [ master ]
+    branches: [ main ]
   pull_request:
-    branches: [ master ]
+    branches: [ main ]
 
 jobs:
   build:
-
     runs-on: ubuntu-latest
 
     steps:
diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml
new file mode 100644
index 00000000..8f096040
--- /dev/null
+++ b/.github/workflows/ruby.yml
@@ -0,0 +1,32 @@
+# This workflow will install Python dependencies, run tests and lint with a single version of Python
+# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
+
+name: Ruby
+
+on:
+  push:
+    branches: [ main ]
+  pull_request:
+    branches: [ main ]
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        ruby: [ 2.7.5, 3.1.1 ]
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v2
+    - name: Set up Ruby
+      uses: ruby/setup-ruby@v1
+      with:
+        ruby-version: ${{ matrix.ruby }}
+    - name: Install dependencies
+      run: cd ruby && bundle install
+    - name: Test with Ruby
+      run: cd ruby && bundle exec rake
+      env:
+          SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
+          SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
diff --git a/java/main/src/main/java/com/saucelabs/saucebindings/SaucePlatform.java b/java/main/src/main/java/com/saucelabs/saucebindings/SaucePlatform.java
index 483d026f..e1df7214 100644
--- a/java/main/src/main/java/com/saucelabs/saucebindings/SaucePlatform.java
+++ b/java/main/src/main/java/com/saucelabs/saucebindings/SaucePlatform.java
@@ -8,10 +8,12 @@
 
 public enum SaucePlatform {
     LINUX("Linux"),
+    WINDOWS_11("Windows 11"),
     WINDOWS_10("Windows 10"),
     WINDOWS_8_1("Windows 8.1"),
     WINDOWS_8("Windows 8"),
-    MAC_BIG_SUR("macOS 11.00"),
+    MAC_MONTEREY("macOS 12"),
+    MAC_BIG_SUR("macOS 11"),
     MAC_CATALINA("macOS 10.15"),
     MAC_MOJAVE("macOS 10.14"),
     MAC_HIGH_SIERRA("macOS 10.13"),
diff --git a/python/saucebindings/options.py b/python/saucebindings/options.py
index 662b2c63..65619822 100644
--- a/python/saucebindings/options.py
+++ b/python/saucebindings/options.py
@@ -72,7 +72,7 @@ def ie(cls, **kwargs):
     @classmethod
     def safari(cls, **kwargs):
         if 'platformName' not in kwargs:
-            kwargs['platformName'] = 'macOS 11.00'
+            kwargs['platformName'] = 'macOS 11'
 
         return cls('safari', validOptions=Configs().safariConfigs(), **kwargs)
 
diff --git a/ruby/Rakefile b/ruby/Rakefile
index 82bb534a..42fe79c6 100644
--- a/ruby/Rakefile
+++ b/ruby/Rakefile
@@ -5,4 +5,16 @@ require 'rspec/core/rake_task'
 
 RSpec::Core::RakeTask.new(:spec)
 
-task default: :spec
+RSpec::Core::RakeTask.new(:examples) do |spec|
+  spec.pattern = 'spec/examples/*_spec.rb'
+end
+
+RSpec::Core::RakeTask.new(:unit) do |spec|
+  spec.pattern = 'spec/unit/*_spec.rb'
+end
+
+RSpec::Core::RakeTask.new(:integration) do |spec|
+  spec.pattern = 'spec/integration/*_spec.rb'
+end
+
+task default: %i[examples unit integration]
diff --git a/ruby/lib/sauce_bindings/options.rb b/ruby/lib/sauce_bindings/options.rb
index e796d968..3609e67e 100644
--- a/ruby/lib/sauce_bindings/options.rb
+++ b/ruby/lib/sauce_bindings/options.rb
@@ -39,7 +39,7 @@ def ie(**opts)
 
       def safari(**opts)
         opts[:browser_name] = 'safari'
-        opts[:platform_name] ||= 'macOS 11.00'
+        opts[:platform_name] ||= 'macOS 11'
         opts[:valid_options] = SafariConfigurations.valid_options
         Options.new(**opts)
       end
diff --git a/ruby/spec/integration/desktop_spec.rb b/ruby/spec/integration/desktop_spec.rb
index 9daebc0a..79a8e078 100644
--- a/ruby/spec/integration/desktop_spec.rb
+++ b/ruby/spec/integration/desktop_spec.rb
@@ -31,6 +31,15 @@ module SauceBindings
         expect(driver).not_to be_nil
         expect(@session.url).to include('eu-central-1')
       end
+
+      it 'executes on APAC' do
+        pending 'Adding Data Center to Sauce Whisk'
+        @session = Session.new(data_center: :APAC_SOUTHEAST)
+        driver = @session.start
+
+        expect(driver).not_to be_nil
+        expect(@session.url).to include('apac-southeast-1')
+      end
     end
   end
 end
diff --git a/ruby/spec/unit/options_spec.rb b/ruby/spec/unit/options_spec.rb
index 6ae67f2c..331d7bc8 100644
--- a/ruby/spec/unit/options_spec.rb
+++ b/ruby/spec/unit/options_spec.rb
@@ -289,7 +289,7 @@ module SauceBindings
 
         expect(options.browser_name).to eq 'safari'
         expect(options.browser_version).to eq 'latest'
-        expect(options.platform_name).to eq 'macOS 11.00'
+        expect(options.platform_name).to eq 'macOS 11'
       end
 
       it 'accepts correct Selenium Options class' do


Test patch:
diff --git a/java/main/src/test/java/com/saucelabs/saucebindings/options/SauceOptionsTest.java b/java/main/src/test/java/com/saucelabs/saucebindings/options/SauceOptionsTest.java
index 541166fa..4e4fc171 100644
--- a/java/main/src/test/java/com/saucelabs/saucebindings/options/SauceOptionsTest.java
+++ b/java/main/src/test/java/com/saucelabs/saucebindings/options/SauceOptionsTest.java
@@ -295,7 +295,7 @@ public void parsesCapabilitiesFromW3CValues() {
         MutableCapabilities expectedCapabilities = new MutableCapabilities();
         expectedCapabilities.setCapability("browserName", "firefox");
         expectedCapabilities.setCapability("browserVersion", "77");
-        expectedCapabilities.setCapability("platformName", "macOS 11.00");
+        expectedCapabilities.setCapability("platformName", "macOS 11");
         expectedCapabilities.setCapability("acceptInsecureCerts", true);
         expectedCapabilities.setCapability("setWindowRect", true);
         expectedCapabilities.setCapability("strictFileInteractability", true);
diff --git a/python/tests/unit/test_safari.py b/python/tests/unit/test_safari.py
index 9a081ec4..52817d53 100644
--- a/python/tests/unit/test_safari.py
+++ b/python/tests/unit/test_safari.py
@@ -12,7 +12,7 @@ def test_defaults(self):
 
         assert sauce.browser_name == 'safari'
         assert sauce.browser_version == 'latest'
-        assert sauce.platform_name == 'macOS 11.00'
+        assert sauce.platform_name == 'macOS 11'
 
     def test_accepts_browser_version_platform_name(self):
         sauce = SauceOptions.safari(browserVersion='75.0', platformName='macOS 10.13')
@@ -359,7 +359,7 @@ def test_capabilities_for_sauce(self):
 
         expected_capabilities = {'browserName': 'safari',
                                  'browserVersion': 'latest',
-                                 'platformName': 'macOS 11.00',
+                                 'platformName': 'macOS 11',
                                  'sauce:options': {'build': 'Sample Build Name',
                                                    'commandTimeout': 2,
                                                    'customData': {'foo': 'foo',
@@ -389,7 +389,7 @@ def test_capabilities_for_selenium(self):
 
         expected_capabilities = {'browserName': 'safari',
                                  'browserVersion': 'latest',
-                                 'platformName': 'macOS 11.00',
+                                 'platformName': 'macOS 11',
                                  'sauce:options': {'build': 'Sample Build Name'}
                                  }