Skip to content

Commit

Permalink
Merge pull request #399 from makakk/master
Browse files Browse the repository at this point in the history
updating hub url
  • Loading branch information
LukaszSiudakiewicz authored Apr 21, 2022
2 parents ec262f0 + efa1578 commit d835e77
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,18 @@ var capabilities = {
'bitbar_apiKey': '<insert your Bitbar API key here>',
'platform': 'Windows',
'browserName': 'Chrome',
'version': '94',
'version': '99',
'resolution': '1920x1080',
'bitbar_project': 'Selenium sample project',
'bitbar_testrun': 'NodeJS sample test',
'bitbar_testTimeout': '600'
}
// user-customizable parameters end here

if (capabilities['platform'].toLowerCase() == 'windows') {
var hub_url = 'https://westeurope-hub.bitbar.com/wd/hub';
} else if (capabilities['platform'].toLowerCase() == 'linux') {
var hub_url = 'https://broker-cloud.bitbar.com/wd/hub';
} else {
throw 'Unsupported platform';
}

async function nodeJsSample() {
try {
var driver = new webdriver.Builder()
.usingServer(hub_url)
.usingServer('https://appium.bitbar.com/wd/hub')
.withCapabilities(capabilities)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

public class BitbarSelenium {

public static final String URL = "https://appium.bitbar.com/wd/hub";

public static void main(String[] args) throws Exception {
// IMPORTANT: Set the following parameters according to your needs.
// You can use Capabilities creator:
Expand All @@ -21,25 +23,14 @@ public static void main(String[] args) throws Exception {
capabilities.setCapability("bitbar_apiKey", "<insert your Bitbar API key here>");
capabilities.setCapability("platform", "Windows");
capabilities.setCapability("browserName", "Chrome");
capabilities.setCapability("version", "94");
capabilities.setCapability("version", "99");
capabilities.setCapability("resolution", "1920x1080");
capabilities.setCapability("bitbar_project", "Selenium sample project");
capabilities.setCapability("bitbar_testrun", "Java sample test");
capabilities.setCapability("bitbar_testTimeout", "600");
// user-customizable parameters end here

String hub_url;
String platform = capabilities.getPlatform().toString().toLowerCase();

if (platform.equals("windows")) {
hub_url = "https://westeurope-hub.bitbar.com/wd/hub";
} else if (platform.equals("linux")) {
hub_url = "https://broker-cloud.bitbar.com/wd/hub";
} else {
throw new Exception("Unsupported platform");
}

WebDriver driver = new RemoteWebDriver(new URL(hub_url), capabilities);
WebDriver driver = new RemoteWebDriver(new URL(URL), capabilities);

// check page title
String test_url = "https://bitbar.github.io/web-testing-target/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def setUp(self):
'bitbar_apiKey': '<insert your Bitbar API key here>',
'platform': 'Windows',
'browserName': 'Chrome',
'version': '94',
'version': '99',
'resolution': '1920x1080',
'bitbar_project': 'Selenium sample project',
'bitbar_testrun': 'Python sample test',
Expand All @@ -30,14 +30,7 @@ def setUp(self):

self.screenshot_dir = os.getcwd() + '/screenshots'

if capabilities['platform'].lower() == 'windows':
hub_url = 'https://westeurope-hub.bitbar.com/wd/hub'
elif capabilities['platform'].lower() == 'linux':
hub_url = 'https://broker-cloud.bitbar.com/wd/hub'
else:
raise Exception("Unsupported platform")

self.driver = webdriver.Remote(command_executor=hub_url,
self.driver = webdriver.Remote(command_executor='https://appium.bitbar.com/wd/hub',
desired_capabilities=capabilities)

def tearDown(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,16 @@
capabilities['bitbar_apiKey'] = '<insert your Bitbar API key here>'
capabilities['platform'] = 'Windows'
capabilities['browserName'] = 'Chrome'
capabilities['version'] = '94'
capabilities['version'] = '99'
capabilities['resolution'] = '1920x1080'
capabilities['bitbar_project'] = 'Selenium sample project'
capabilities['bitbar_testrun'] = 'Ruby sample test'
capabilities['bitbar_testTimeout'] = '600'
# user-customizable parameters end here

if capabilities['platform'].downcase == 'windows'
hub_url = "https://westeurope-hub.bitbar.com/wd/hub"
elsif capabilities['platform'].downcase == 'linux'
hub_url = "https://broker-cloud.bitbar.com/wd/hub"
else
raise "Unsupported platform"
end

begin
driver = Selenium::WebDriver.for(:remote,
:url => hub_url,
:url => "https://appium.bitbar.com/wd/hub",
:capabilities => capabilities)

# check page title
Expand Down

0 comments on commit d835e77

Please sign in to comment.