-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Headless chrome/firefox support changes and misc
- Removed TravisCICapabilitiyBuilder -- no longer needed - Added test for headless chrome and firefox capability builders - Use firefox-esr instead on travisci - extract method refactoring in Chrome and Firefox capability builder classes
- Loading branch information
Showing
10 changed files
with
153 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 0 additions & 70 deletions
70
client/src/test/java/com/paypal/selion/TravisCICapabilityBuilder.java
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
...ion/internal/platform/grid/browsercapabilities/HeadlessChromeCapabilitiesBuilderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/*-------------------------------------------------------------------------------------------------------------------*\ | ||
| Copyright (C) 2017 PayPal | | ||
| | | ||
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance | | ||
| with the License. | | ||
| | | ||
| You may obtain a copy of the License at | | ||
| | | ||
| http://www.apache.org/licenses/LICENSE-2.0 | | ||
| | | ||
| Unless required by applicable law or agreed to in writing, software distributed under the License is distributed | | ||
| on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for | | ||
| the specific language governing permissions and limitations under the License. | | ||
\*-------------------------------------------------------------------------------------------------------------------*/ | ||
|
||
package com.paypal.selion.internal.platform.grid.browsercapabilities; | ||
|
||
import static org.testng.Assert.*; | ||
|
||
import com.paypal.selion.configuration.Config; | ||
import com.paypal.selion.configuration.ConfigManager; | ||
import com.paypal.selion.configuration.LocalConfig; | ||
import org.openqa.selenium.chrome.ChromeOptions; | ||
import org.openqa.selenium.remote.DesiredCapabilities; | ||
import org.testng.ITestContext; | ||
import org.testng.annotations.Test; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
|
||
public class HeadlessChromeCapabilitiesBuilderTest { | ||
@Test | ||
public void testIsHeadless(ITestContext ctx) { | ||
//first set a local config to not run this @test headless | ||
LocalConfig lc = new LocalConfig(); | ||
lc.setConfigProperty(Config.ConfigProperty.BROWSER_RUN_HEADLESS, "false"); | ||
ConfigManager.addConfig(ctx.getCurrentXmlTest().getName(), lc); | ||
|
||
DesiredCapabilities capabilities = | ||
new HeadlessChromeCapabilitiesBuilder().getCapabilities(new DesiredCapabilities()); | ||
|
||
//assert the capabilities returned includes the '--headless' argument. | ||
assertNotNull(capabilities.getCapability(ChromeOptions.CAPABILITY)); | ||
|
||
Map<String, List<String>> chromeOptionsMap = | ||
(Map<String, List<String>>) capabilities.getCapability(ChromeOptions.CAPABILITY); | ||
assertTrue(chromeOptionsMap.containsKey("args")); | ||
assertTrue(chromeOptionsMap.get("args").contains("--headless")); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...on/internal/platform/grid/browsercapabilities/HeadlessFirefoxCapabilitiesBuilderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/*-------------------------------------------------------------------------------------------------------------------*\ | ||
| Copyright (C) 2017 PayPal | | ||
| | | ||
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance | | ||
| with the License. | | ||
| | | ||
| You may obtain a copy of the License at | | ||
| | | ||
| http://www.apache.org/licenses/LICENSE-2.0 | | ||
| | | ||
| Unless required by applicable law or agreed to in writing, software distributed under the License is distributed | | ||
| on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for | | ||
| the specific language governing permissions and limitations under the License. | | ||
\*-------------------------------------------------------------------------------------------------------------------*/ | ||
|
||
package com.paypal.selion.internal.platform.grid.browsercapabilities; | ||
|
||
import static org.testng.Assert.*; | ||
|
||
import com.paypal.selion.configuration.Config; | ||
import com.paypal.selion.configuration.ConfigManager; | ||
import com.paypal.selion.configuration.LocalConfig; | ||
import org.openqa.selenium.firefox.FirefoxOptions; | ||
import org.openqa.selenium.remote.DesiredCapabilities; | ||
import org.testng.ITestContext; | ||
import org.testng.annotations.Test; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
|
||
public class HeadlessFirefoxCapabilitiesBuilderTest { | ||
@Test | ||
public void testIsHeadless(ITestContext ctx) { | ||
//first set a local config to not run this @test headless | ||
LocalConfig lc = new LocalConfig(); | ||
lc.setConfigProperty(Config.ConfigProperty.BROWSER_RUN_HEADLESS, "false"); | ||
ConfigManager.addConfig(ctx.getCurrentXmlTest().getName(), lc); | ||
|
||
DesiredCapabilities capabilities = | ||
new HeadlessFirefoxCapabilitiesBuilder().getCapabilities(new DesiredCapabilities()); | ||
|
||
//assert the capabilities returned includes the '-headless' argument. | ||
assertNotNull(capabilities.getCapability(FirefoxOptions.FIREFOX_OPTIONS)); | ||
|
||
Map<String, List<String>> firefoxOptionsMap = | ||
(Map<String, List<String>>) capabilities.getCapability(FirefoxOptions.FIREFOX_OPTIONS); | ||
assertTrue(firefoxOptionsMap.containsKey("args")); | ||
assertTrue(firefoxOptionsMap.get("args").contains("-headless")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters