Skip to content

Commit ff3558b

Browse files
committed
update iOS test script and dependency
1 parent df83197 commit ff3558b

File tree

10 files changed

+70
-82
lines changed

10 files changed

+70
-82
lines changed

ios/conf/local.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ exports.config = {
1313
capabilities: [{
1414
name: 'local_appium_test',
1515
build: 'webdriver-browserstack',
16-
device: 'iPhone 7',
16+
device: 'iPhone 11 Pro',
1717
app: process.env.BROWSERSTACK_APP_ID || 'bs://<hashed app-id>',
1818
'browserstack.local': true,
1919
'browserstack.debug': true
2020
}],
2121

22-
logLevel: 'verbose',
22+
logLevel: 'info',
2323
coloredLogs: true,
2424
screenshotPath: './errorShots/',
2525
baseUrl: '',

ios/conf/multiple.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ exports.config = {
1111
capabilities: [{
1212
name: 'multiple_appium_test',
1313
build: 'webdriver-browserstack',
14-
device: 'iPhone 7',
14+
device: 'iPhone 11 Pro',
1515
app: process.env.BROWSERSTACK_APP_ID || 'bs://<hashed app-id>',
1616
'browserstack.debug': true
1717
}],
1818

19-
logLevel: 'verbose',
19+
logLevel: 'info',
2020
coloredLogs: true,
2121
screenshotPath: './errorShots/',
2222
baseUrl: '',

ios/conf/parallel.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ exports.config = {
1717
},
1818

1919
capabilities: [{
20-
"device": "iPhone 7"
20+
"device": "iPhone 11 Pro"
2121
}, {
22-
"device": "iPhone 7 Plus"
22+
"device": "iPhone 11 Pro Max"
2323
}],
2424

25-
logLevel: 'verbose',
25+
logLevel: 'info',
2626
coloredLogs: true,
2727
screenshotPath: './errorShots/',
2828
baseUrl: '',

ios/conf/single.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ exports.config = {
1111
capabilities: [{
1212
name: 'single_appium_test',
1313
build: 'webdriver-browserstack',
14-
device: 'iPhone 7',
14+
device: 'iPhone 11 Pro',
1515
app: process.env.BROWSERSTACK_APP_ID || 'bs://<hashed app-id>',
1616
'browserstack.debug': true
1717
}],
1818

19-
logLevel: 'verbose',
19+
logLevel: 'info',
2020
coloredLogs: true,
2121
screenshotPath: './errorShots/',
2222
baseUrl: '',

ios/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@
2525
},
2626
"homepage": "https://github.com/browserstack/webdriverio-appium-app-browserstack#readme",
2727
"dependencies": {
28-
"browserstack-local": "^1.0.0",
29-
"webdriverio": "^4.0.5"
28+
"browserstack-local": "^1.4.5"
3029
},
3130
"devDependencies": {
32-
"wdio-mocha-framework": "^0.2.11"
31+
"@wdio/cli": "^6.4.1",
32+
"@wdio/local-runner": "^6.4.1",
33+
"@wdio/mocha-framework": "^6.4.0",
34+
"@wdio/sync": "^6.4.0"
3335
}
3436
}

ios/tests/specs/local_test.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@ var assert = require('assert');
33

44
describe('BrowserStack Local Testing', function () {
55
it('can check tunnel working', function () {
6-
var searchSelector = `~Test BrowserStackLocal connection`;
7-
browser.waitForVisible(searchSelector, 30000);
8-
browser
9-
.element(searchSelector)
10-
.click();
6+
var searchSelector = $(`~Test BrowserStackLocal connection`);
7+
searchSelector.waitForDisplayed({ timeout: 30000 });
8+
searchSelector.click();
119

12-
var responseText = `~Response is: Up and running`;
13-
browser.waitForVisible(responseText, 30000);
14-
var allTextElements = browser.elements(responseText).value;
10+
var allTextElements = $$(`~ResultBrowserStackLocal`);
11+
browser.pause(10000);
1512

1613
var testElement = null;
1714
allTextElements.forEach(function (textElement) {
18-
var textContent = browser.elementIdText(textElement['ELEMENT']).value;
15+
var textContent = textElement.getText();
1916
if (textContent.indexOf('Up and running') !== -1) {
2017
testElement = textElement;
2118
}
@@ -28,7 +25,7 @@ describe('BrowserStack Local Testing', function () {
2825
throw new Error('Cannot find the Up and running response');
2926
}
3027

31-
var matchedString = browser.elementIdText(testElement['ELEMENT']).value;
28+
var matchedString = testElement.getText();
3229
assert(matchedString == 'Response is: Up and running');
3330
});
3431
});

ios/tests/specs/multiple/test_01.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,25 @@ var assert = require('assert');
22

33
describe('Text Verification', function () {
44
it('should match displayed text with input text', function () {
5-
var textButton = `~Text Button`;
6-
browser.waitForVisible(textButton, 30000);
7-
browser
8-
.element(textButton)
9-
.click();
5+
var textButton = $(`~Text Button`);
6+
textButton.waitForDisplayed({ timeout: 30000 });
7+
textButton.click();
108

11-
var textInput = `~Text Input`;
12-
browser.waitForVisible(textInput, 30000);
13-
browser
14-
.element(textInput)
15-
.click()
16-
.keys("[email protected]"+"\n");
9+
var textInput = $(`~Text Input`);
10+
textInput.waitForDisplayed({ timeout: 30000 });
11+
textInput.click()
12+
textInput.addValue("[email protected]"+"\n");
1713

18-
var textOutput = `~Text Output`;
19-
browser.waitForVisible(textOutput, 30000);
20-
var value = browser.getText(textOutput)
14+
var textOutput = $(`~Text Output`);
15+
textOutput.waitForDisplayed({ timeout: 30000 });
16+
var value = textOutput.getText();
2117

2218
if (value === "[email protected]")
2319
assert(true)
2420
else
2521
assert(false)
26-
22+
23+
var back = $('~UI Elements');
24+
back.click();
2725
});
2826
});

ios/tests/specs/multiple/test_02.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,25 @@ var assert = require('assert');
22

33
describe('Text Verification', function () {
44
it('should match displayed text with input text', function () {
5-
var textButton = `~Text Button`;
6-
browser.waitForVisible(textButton, 30000);
7-
browser
8-
.element(textButton)
9-
.click();
5+
var textButton = $(`~Text Button`);
6+
textButton.waitForDisplayed({ timeout: 30000 });
7+
textButton.click();
108

11-
var textInput = `~Text Input`;
12-
browser.waitForVisible(textInput, 30000);
13-
browser
14-
.element(textInput)
15-
.click()
16-
.keys("[email protected]"+"\n");
9+
var textInput = $(`~Text Input`);
10+
textInput.waitForDisplayed({ timeout: 30000 });
11+
textInput.click()
12+
textInput.addValue("[email protected]"+"\n");
1713

18-
var textOutput = `~Text Output`;
19-
browser.waitForVisible(textOutput, 30000);
20-
var value = browser.getText(textOutput)
14+
var textOutput = $(`~Text Output`);
15+
textOutput.waitForDisplayed({ timeout: 30000 });
16+
var value = textOutput.getText();
2117

2218
if (value === "[email protected]")
2319
assert(true)
2420
else
2521
assert(false)
26-
22+
23+
var back = $('~UI Elements');
24+
back.click();
2725
});
2826
});

ios/tests/specs/multiple/test_03.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,25 @@ var assert = require('assert');
22

33
describe('Text Verification', function () {
44
it('should match displayed text with input text', function () {
5-
var textButton = `~Text Button`;
6-
browser.waitForVisible(textButton, 30000);
7-
browser
8-
.element(textButton)
9-
.click();
5+
var textButton = $(`~Text Button`);
6+
textButton.waitForDisplayed({ timeout: 30000 });
7+
textButton.click();
108

11-
var textInput = `~Text Input`;
12-
browser.waitForVisible(textInput, 30000);
13-
browser
14-
.element(textInput)
15-
.click()
16-
.keys("[email protected]"+"\n");
9+
var textInput = $(`~Text Input`);
10+
textInput.waitForDisplayed({ timeout: 30000 });
11+
textInput.click()
12+
textInput.addValue("[email protected]"+"\n");
1713

18-
var textOutput = `~Text Output`;
19-
browser.waitForVisible(textOutput, 30000);
20-
var value = browser.getText(textOutput)
14+
var textOutput = $(`~Text Output`);
15+
textOutput.waitForDisplayed({ timeout: 30000 });
16+
var value = textOutput.getText();
2117

2218
if (value === "[email protected]")
2319
assert(true)
2420
else
2521
assert(false)
2622

23+
var back = $('~UI Elements');
24+
back.click();
2725
});
2826
});

ios/tests/specs/single_test.js

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,22 @@ var assert = require('assert');
22

33
describe('Text Verification', function () {
44
it('should match displayed text with input text', function () {
5-
var textButton = `~Text Button`;
6-
browser.waitForVisible(textButton, 30000);
7-
browser
8-
.element(textButton)
9-
.click();
5+
var textButton = $(`~Text Button`);
6+
textButton.waitForDisplayed({ timeout: 30000 });
7+
textButton.click();
108

11-
var textInput = `~Text Input`;
12-
browser.waitForVisible(textInput, 30000);
13-
browser
14-
.element(textInput)
15-
.click()
16-
.keys("[email protected]"+"\n");
9+
var textInput = $(`~Text Input`);
10+
textInput.waitForDisplayed({ timeout: 30000 });
11+
textInput.click()
12+
textInput.addValue("[email protected]"+"\n");
1713

18-
var textOutput = `~Text Output`;
19-
browser.waitForVisible(textOutput, 30000);
20-
var value = browser.getText(textOutput)
14+
var textOutput = $(`~Text Output`);
15+
textOutput.waitForDisplayed({ timeout: 30000 });
16+
var value = textOutput.getText();
2117

2218
if (value === "[email protected]")
2319
assert(true)
2420
else
2521
assert(false)
26-
2722
});
28-
});
23+
});

0 commit comments

Comments
 (0)