Skip to content

Commit

Permalink
isAppium -> use_appium
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 committed Dec 26, 2022
1 parent 7b40016 commit c76e481
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion lib/runner/cli/cli.js
Expand Up @@ -469,7 +469,7 @@ class CliRunner {
let promise = Promise.resolve();

if (this.test_settings.selenium && this.test_settings.selenium.start_process) {
const Server = this.test_settings.selenium.isAppium
const Server = this.test_settings.selenium.use_appium
? require('../../transport/selenium-webdriver/appium.js')
: require('../../transport/selenium-webdriver/selenium.js');

Expand Down
6 changes: 3 additions & 3 deletions lib/transport/factory.js
Expand Up @@ -49,7 +49,7 @@ module.exports = class TransportFactory {
let {browserName} = settings.desiredCapabilities;

// Better support for Appium, if the browserName has explicitly been set to null we can skip all further checks
if (settings.selenium && settings.selenium.isAppium && !browserName) {
if (settings.selenium && settings.selenium.use_appium && !browserName) {
return browserName;
}

Expand All @@ -62,7 +62,7 @@ module.exports = class TransportFactory {
//
// put a warning here that if trying to connect to an Appium server,
// just setting browserName=null will not work in the future.
settings.selenium.isAppium = true;
settings.selenium.use_appium = true;

return browserName;
}
Expand Down Expand Up @@ -106,7 +106,7 @@ module.exports = class TransportFactory {
}

if (usingSeleniumServer) {
if (nightwatchInstance.settings.selenium.isAppium) {
if (nightwatchInstance.settings.selenium.use_appium) {
const Appium = require('./selenium-webdriver/appium.js');

return new Appium(nightwatchInstance, browserName);
Expand Down
2 changes: 1 addition & 1 deletion lib/transport/selenium-webdriver/options.js
Expand Up @@ -251,7 +251,7 @@ module.exports = class SeleniumCapabilities {
if (this.shouldSetupWebdriver()) {
try {
if (this.usingSeleniumServer()) {
if (this.settings.selenium.isAppium) {
if (this.settings.selenium.use_appium) {
this.settings.selenium.server_path = this.settings.webdriver.server_path = this.getAppiumPath();

return this;
Expand Down
2 changes: 1 addition & 1 deletion test/src/api/commands/element/testClick.js
Expand Up @@ -195,7 +195,7 @@ describe('.click()', function() {
silent: false,
selenium: {
start_process: false,
isAppium: true,
use_appium: true,
port: 10195,
host: 'localhost'
},
Expand Down
10 changes: 5 additions & 5 deletions test/src/cli/testServiceCreationFromCli.js
Expand Up @@ -4,7 +4,7 @@ const assert = require('assert');
const origPath = require('path');

describe('Service creation from cli.js', function() {
this.timeout(5000);
this.timeout(10000);

beforeEach(function() {
mockery.enable({useCleanCache: true, warnOnUnregistered: false});
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('Service creation from cli.js', function() {
output_folder: false,
selenium: {
start_process: true,
isAppium: true
use_appium: true
},
test_settings: {
'default': {
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('Service creation from cli.js', function() {
output_folder: false,
selenium: {
start_process: true,
isAppium: true,
use_appium: true,
server_path: 'appium'
},
test_settings: {
Expand Down Expand Up @@ -189,7 +189,7 @@ describe('Service creation from cli.js', function() {
output_folder: false,
selenium: {
start_process: false,
isAppium: true,
use_appium: true,
host: 'localhost'
},
test_settings: {
Expand Down Expand Up @@ -221,7 +221,7 @@ describe('Service creation from cli.js', function() {
});
});

it('test selenium server startup if isAppium not used', function() {
it('test selenium server startup if use_appium not used', function() {
mockery.registerMock('./appium_config.json', {
src_folders: ['test/sampletests/before-after'],
output_folder: false,
Expand Down
4 changes: 2 additions & 2 deletions test/src/index/transport/testAppiumTransport.js
Expand Up @@ -9,7 +9,7 @@ describe('AppiumTransport', function () {
const client = NightwatchClient.client({
selenium: {
start_process: false,
isAppium: true,
use_appium: true,
host: 'remote.host',
port: 443
},
Expand Down Expand Up @@ -39,7 +39,7 @@ describe('AppiumTransport', function () {
const client = NightwatchClient.client({
selenium: {
start_process: true,
isAppium: true
use_appium: true
},
webdriver: {
start_process: false
Expand Down
6 changes: 3 additions & 3 deletions test/src/index/transport/testMobileOptions.js
Expand Up @@ -71,7 +71,7 @@ describe('Test mobile options in Nightwatch/Appium client', function () {
it('have isIOS() for native testing on iOS', function () {
const client = Nightwatch.createClient({
selenium: {
isAppium: true
use_appium: true
},
desiredCapabilities: {
browserName: null,
Expand All @@ -91,7 +91,7 @@ describe('Test mobile options in Nightwatch/Appium client', function () {
it('have isAndroid() for native testing on Android', function () {
const client = Nightwatch.createClient({
selenium: {
isAppium: true
use_appium: true
},
desiredCapabilities: {
browserName: '',
Expand All @@ -110,7 +110,7 @@ describe('Test mobile options in Nightwatch/Appium client', function () {
it('have isAndroid() for web testing on Android using Appium', function () {
const client = Nightwatch.createClient({
selenium: {
isAppium: true
use_appium: true
},
desiredCapabilities: {
browserName: 'Chrome',
Expand Down
6 changes: 3 additions & 3 deletions test/src/service-builders/testAppiumServer.js
Expand Up @@ -243,7 +243,7 @@ describe('AppiumServer Transport Tests', function () {
},
selenium: {
port: 9999,
isAppium: true,
use_appium: true,
start_process: true,
// server_path is only set automatically when server is started from cli.js
server_path: '/path/to/appium/main.js'
Expand Down Expand Up @@ -286,7 +286,7 @@ describe('AppiumServer Transport Tests', function () {
},
selenium: {
start_process: true,
isAppium: true,
use_appium: true,
server_path: 'appium',
cli_args: [
'--allow-insecure=chromedriver_autodownload'
Expand Down Expand Up @@ -323,7 +323,7 @@ describe('AppiumServer Transport Tests', function () {
host: 'somewhere',
port: '4725',
start_process: false,
isAppium: true
use_appium: true
}
});

Expand Down

0 comments on commit c76e481

Please sign in to comment.