Skip to content

Commit ead1235

Browse files
4D6172784D617278
4D617278
authored and
4D617278
committedAug 14, 2020
Fixed first digit bug
1 parent ae8cc2f commit ead1235

File tree

8 files changed

+243
-238
lines changed

8 files changed

+243
-238
lines changed
 

‎installUbuntu.sh ‎installwindows.sh

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#For Ubuntu 20.04 only
21
#!/usr/bin/env bash
32

43
function error() { echo -e "\e[1;31m$1\e[0m"; exit 1; }

‎src/js/components/Settings/SettingsVerifySecretCode.jsx

+124-28
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,22 @@ class SettingsVerifySecretCode extends Component {
152152
}
153153

154154
onDigit1Change (e) {
155-
const regex = /^[0-9]$/;
156-
const digit = e.target.value;
157-
if (regex.test(digit)) {
155+
const regex1 = /^[0-9]$/;
156+
const regex2 = /^[0-9]{7}$/;
157+
var digit;
158+
159+
if (regex1.test(e.target.value)) {
160+
digit = e.target.value;
161+
} else if (regex2.test(e.target.value)) { // change is fired on paste, resulting in multiple digits
162+
return;
163+
} else {
164+
digit = '';
165+
}
166+
167+
console.log('e' + e.target.value);
168+
console.log('Digit' + digit);
169+
170+
if (digit) {
158171
e.target.blur();
159172
e.target.parentElement.nextElementSibling.firstElementChild.focus();
160173
this.setState({
@@ -175,10 +188,24 @@ class SettingsVerifySecretCode extends Component {
175188
}
176189
}
177190

191+
178192
onDigit2Change (e) {
179-
const regex = /^[0-9]$/;
180-
const digit = e.target.value;
181-
if (regex.test(digit)) {
193+
const regex1 = /^[0-9]$/;
194+
const regex2 = /^[0-9]{7}$/;
195+
var digit;
196+
197+
if (regex1.test(e.target.value)) {
198+
digit = e.target.value;
199+
} else if (regex2.test(e.target.value)) { // change is fired on paste, resulting in multiple digits
200+
return;
201+
} else {
202+
digit = '';
203+
}
204+
205+
console.log('e' + e.target.value);
206+
console.log('Digit' + digit);
207+
208+
if (digit) {
182209
e.target.blur();
183210
e.target.parentElement.nextElementSibling.firstElementChild.focus();
184211
this.setState({
@@ -188,7 +215,9 @@ class SettingsVerifySecretCode extends Component {
188215
});
189216
e.target.value = digit;
190217
e.target.blur();
191-
e.target.parentElement.nextElementSibling.firstElementChild.nextElementSibling.focus();
218+
if (!pasted) {
219+
e.target.parentElement.nextElementSibling.firstElementChild.nextElementSibling.focus();
220+
}
192221
} else {
193222
e.target.value = '';
194223
this.setState({
@@ -200,9 +229,22 @@ class SettingsVerifySecretCode extends Component {
200229
}
201230

202231
onDigit3Change (e) {
203-
const regex = /^[0-9]$/;
204-
const digit = e.target.value;
205-
if (regex.test(digit)) {
232+
const regex1 = /^[0-9]$/;
233+
const regex2 = /^[0-9]{7}$/;
234+
var digit;
235+
236+
if (regex1.test(e.target.value)) {
237+
digit = e.target.value;
238+
} else if (regex2.test(e.target.value)) { // change is fired on paste, resulting in multiple digits
239+
return;
240+
} else {
241+
digit = '';
242+
}
243+
244+
console.log('e' + e.target.value);
245+
console.log('Digit' + digit);
246+
247+
if (digit) {
206248
e.target.blur();
207249
e.target.parentElement.nextElementSibling.firstElementChild.focus();
208250
this.setState({
@@ -212,7 +254,9 @@ class SettingsVerifySecretCode extends Component {
212254
});
213255
e.target.value = digit;
214256
e.target.blur();
215-
e.target.parentElement.nextElementSibling.firstElementChild.nextElementSibling.focus();
257+
if (!pasted) {
258+
e.target.parentElement.nextElementSibling.firstElementChild.nextElementSibling.focus();
259+
}
216260
} else {
217261
e.target.value = '';
218262
this.setState({
@@ -224,9 +268,22 @@ class SettingsVerifySecretCode extends Component {
224268
}
225269

226270
onDigit4Change (e) {
227-
const regex = /^[0-9]$/;
228-
const digit = e.target.value;
229-
if (regex.test(digit)) {
271+
const regex1 = /^[0-9]$/;
272+
const regex2 = /^[0-9]{7}$/;
273+
var digit;
274+
275+
if (regex1.test(e.target.value)) {
276+
digit = e.target.value;
277+
} else if (regex2.test(e.target.value)) { // change is fired on paste, resulting in multiple digits
278+
return;
279+
} else {
280+
digit = '';
281+
}
282+
283+
console.log('e' + e.target.value);
284+
console.log('Digit' + digit);
285+
286+
if (digit) {
230287
e.target.blur();
231288
e.target.parentElement.nextElementSibling.firstElementChild.focus();
232289
this.setState({
@@ -236,7 +293,9 @@ class SettingsVerifySecretCode extends Component {
236293
});
237294
e.target.value = digit;
238295
e.target.blur();
239-
e.target.parentElement.nextElementSibling.firstElementChild.nextElementSibling.focus();
296+
if (!pasted) {
297+
e.target.parentElement.nextElementSibling.firstElementChild.nextElementSibling.focus();
298+
}
240299
} else {
241300
e.target.value = '';
242301
this.setState({
@@ -247,10 +306,24 @@ class SettingsVerifySecretCode extends Component {
247306
}
248307
}
249308

309+
250310
onDigit5Change (e) {
251-
const regex = /^[0-9]$/;
252-
const digit = e.target.value;
253-
if (regex.test(digit)) {
311+
const regex1 = /^[0-9]$/;
312+
const regex2 = /^[0-9]{7}$/;
313+
var digit;
314+
315+
if (regex1.test(e.target.value)) {
316+
digit = e.target.value;
317+
} else if (regex2.test(e.target.value)) { // change is fired on paste, resulting in multiple digits
318+
return;
319+
} else {
320+
digit = '';
321+
}
322+
323+
console.log('e' + e.target.value);
324+
console.log('Digit' + digit);
325+
326+
if (digit) {
254327
e.target.blur();
255328
e.target.parentElement.nextElementSibling.firstElementChild.focus();
256329
this.setState({
@@ -260,7 +333,9 @@ class SettingsVerifySecretCode extends Component {
260333
});
261334
e.target.value = digit;
262335
e.target.blur();
263-
e.target.parentElement.nextElementSibling.firstElementChild.nextElementSibling.focus();
336+
if (!pasted) {
337+
e.target.parentElement.nextElementSibling.firstElementChild.nextElementSibling.focus();
338+
}
264339
} else {
265340
e.target.value = '';
266341
this.setState({
@@ -272,15 +347,34 @@ class SettingsVerifySecretCode extends Component {
272347
}
273348

274349
onDigit6Change (e) {
275-
const regex = /^[0-9]$/;
276-
const digit = e.target.value;
277-
if (regex.test(digit)) {
350+
const regex1 = /^[0-9]$/;
351+
const regex2 = /^[0-9]{7}$/;
352+
var digit;
353+
354+
if (regex1.test(e.target.value)) {
355+
digit = e.target.value;
356+
} else if (regex2.test(e.target.value)) { // change is fired on paste, resulting in multiple digits
357+
return;
358+
} else {
359+
digit = '';
360+
}
361+
362+
console.log('e' + e.target.value);
363+
console.log('Digit' + digit);
364+
365+
if (digit) {
366+
e.target.blur();
367+
e.target.parentElement.nextElementSibling.firstElementChild.focus();
278368
this.setState({
279369
digit6: digit,
280370
errorToDisplay: false,
281371
errorMessageToDisplay: '',
282372
});
283373
e.target.value = digit;
374+
e.target.blur();
375+
if (!pasted) {
376+
e.target.parentElement.nextElementSibling.firstElementChild.nextElementSibling.focus();
377+
}
284378
} else {
285379
e.target.value = '';
286380
this.setState({
@@ -293,8 +387,6 @@ class SettingsVerifySecretCode extends Component {
293387

294388
// eslint-disable-next-line react/sort-comp
295389
onPaste (e) {
296-
// console.log(e.clipboardData.getData('Text'));
297-
298390
const pastedInputArray = e.clipboardData.getData('Text').split('');
299391
// console.log(pastedInputArray);
300392

@@ -310,13 +402,17 @@ class SettingsVerifySecretCode extends Component {
310402
digit4: allDigits[3],
311403
digit5: allDigits[4],
312404
digit6: allDigits[5],
313-
});
314-
document.getElementById('digit1').blur(); // If we leave the focus, the box doesn't fill
315-
// document.getElementById('digit6').focus(); // If we focus, it clears the box
316-
this.setState({
317405
errorToDisplay: false,
318406
errorMessageToDisplay: '',
319407
});
408+
409+
document.getElementById('digit1').blur(); // prevents change from firing on chrome
410+
document.getElementById('digit2').blur(); // prevents change from firing on chrome
411+
document.getElementById('digit3').blur(); // prevents change from firing on chrome
412+
document.getElementById('digit4').blur(); // prevents change from firing on chrome
413+
document.getElementById('digit5').blur(); // prevents change from firing on chrome
414+
document.getElementById('digit6').blur(); // prevents change from firing on chrome
415+
320416
} else {
321417
this.setState({
322418
digit1: '',

‎tests/browserstack/devices_to_test.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{"Android":
2-
{"0": {"os_version": "8.0", "device": "Samsung Galaxy S9 Plus", "browserName": "Android", "browserstack.appium_version": "1.17.0"},
2+
{"0": {"os_version": "9.0", "device": "Samsung Galaxy S9 Plus", "browserName": "Android", "browserstack.appium_version": "1.17.0"},
33
"1": {"os_version": "8.1", "device": "Samsung Galaxy J7 Prime", "browserName": "Android", "browserstack.appium_version": "1.17.0"},
44
"2": {"os_version": "7.0", "device": "Samsung Galaxy S8", "browserName": "Android", "browserstack.appium_version": "1.17.0"},
55
"3": {"os_version": "10.0", "device": "Google Pixel 4", "browserName": "Android", "browserstack.appium_version": "1.17.0"},

‎tests/browserstack/specs/ballotMainTest.js

+13-27
Original file line numberDiff line numberDiff line change
@@ -222,31 +222,17 @@ describe('Cross browser automated testing', async () => {
222222
}
223223
});
224224

225-
if (isCordovaFromAppStore && isAndroid) {
226-
it('should go to the friends tab', async() => {
227-
if (isDesktopScreenSize) {
228-
await simpleClick('friendsTabHeaderBar');
229-
} else {
230-
await simpleClick('friendsTabFooterBar'); // Click friends tab
231-
}
232-
await simpleTextInput('EmailAddress', 'automated_voter1@WeVote.info');
233-
await selectClick('.card-main');
234-
await simpleClick('friendsNextButton');
235-
await browser.deleteSession();
236-
});
237-
} else {
238-
it('should go to the news tab', async() => {
239-
if (isDesktopScreenSize) {
240-
await simpleClick('activityTabHeaderBar');
241-
await simpleTextInput('EmailAddress-sidebar', 'automated_voter1@WeVote.info');
242-
await simpleTextInput('friendFirstName-sidebar', xssTest);
243-
await simpleTextInput('friendLastName-sidebar', sqlTest);
244-
await simpleTextInput('addFriendsMessage-sidebar', xssTest2);
245-
await selectClick('friendsNextButton-sidebar');
246-
} else {
247-
await simpleClick('newsTabFooterBar'); // Click friends tab
248-
}
249-
await browser.deleteSession();
250-
});
251-
}
225+
it('should go to the news tab', async() => {
226+
if (isDesktopScreenSize) {
227+
await simpleClick('activityTabHeaderBar');
228+
await simpleTextInput('EmailAddress-sidebar', 'automated_voter1@WeVote.info');
229+
await simpleTextInput('friendFirstName-sidebar', xssTest);
230+
await simpleTextInput('friendLastName-sidebar', sqlTest);
231+
await simpleTextInput('addFriendsMessage-sidebar', xssTest2);
232+
await selectClick('friendsNextButton-sidebar');
233+
} else {
234+
await simpleClick('newsTabFooterBar'); // Click friends tab
235+
}
236+
await browser.deleteSession();
237+
});
252238
});

‎tests/browserstack/specs/profileMainTest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ describe('Cross browser automated testing', async () => {
161161
// });
162162

163163
it('should test settings page', async () => {
164-
if (isCordovaFromAppStore && isIOS) {
164+
if (isCordovaFromAppStore) {
165165
await browser.deleteSession();
166166
}
167167
// await browser.pause(PAUSE_DURATION_MICROSECONDS * 10);

‎tests/browserstack/wdio.conf.js

+41-92
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Can not set browser.geoLocation and browser.local simultaneously
12
const browserStackConfig = require('./browserstack.config');
23

34
const date = new Date();
@@ -16,108 +17,56 @@ exports.config = {
1617
exclude: [],
1718
capabilities: [
1819
{
19-
name: 'readyMainTest: iPhone XR 12',
20+
name: 'readyMainTest: Samsung Galaxy S20 Plus 10.0',
2021
build: buildNameForDisplay,
21-
device: 'iPhone XR',
22-
os_version: '12',
23-
app: browserStackConfig.BROWSERSTACK_IPA_URL,
24-
browserName: 'iPhone',
22+
device: 'Samsung Galaxy S20 Plus',
23+
os_version: '10.0',
24+
app: browserStackConfig.BROWSERSTACK_APK_URL,
25+
browserName: 'Android',
2526
real_mobile: true,
26-
acceptSslCerts: true,
2727
'browserstack.console': 'info',
2828
'browserstack.appium_version': '1.17.0',
2929
'browserstack.local': false,
30-
'browser.geoLocation': 'US',
31-
isAndroid: false,
30+
isAndroid: true,
3231
isCordovaFromAppStore: true,
33-
isIOS: true,
32+
isIOS: false,
3433
isMobileScreenSize: true,
3534
},
36-
// {
37-
// name: 'readyMainTest: %device1%os1 %os_version1',
38-
// build: buildNameForDisplay,
39-
// device: '%device1',
40-
// os: '%os1',
41-
// os_version: '%os_version1',
42-
// app: browserStackConfig.BROWSERSTACK_IPA_URL,
43-
// browserName: '%browserName1',
44-
// browser_version: '%browser_version1',
45-
// real_mobile: true,
46-
// acceptSslCerts: true,
47-
// 'browserstack.console': 'info',
48-
// 'browserstack.appium_version': '%browserstack.appium_version1',
49-
// 'browserstack.local': false,
50-
// 'browser.geoLocation': 'US',
51-
// isAndroid: false,
52-
// isCordovaFromAppStore: true,
53-
// isIOS: true,
54-
// isMobileScreenSize: true,
55-
// },
56-
// {
57-
// name: 'readyMainTest: %device2%os2 %os_version2',
58-
// build: buildNameForDisplay,
59-
// device: '%device2',
60-
// os: '%os2',
61-
// os_version: '%os_version2',
62-
// app: browserStackConfig.BROWSERSTACK_IPA_URL,
63-
// browserName: '%browserName2',
64-
// browser_version: '%browser_version2',
65-
// real_mobile: true,
66-
// acceptSslCerts: true,
67-
// 'browserstack.console': 'info',
68-
// 'browserstack.appium_version': '%browserstack.appium_version2',
69-
// 'browserstack.local': false,
70-
// 'browser.geoLocation': 'US',
71-
// isAndroid: false,
72-
// isCordovaFromAppStore: true,
73-
// isIOS: true,
74-
// isMobileScreenSize: true,
75-
// },
76-
// {
77-
// name: 'readyMainTest: %device3%os3 %os_version3',
78-
// build: buildNameForDisplay,
79-
// device: '%device3',
80-
// os: '%os3',
81-
// os_version: '%os_version3',
82-
// app: browserStackConfig.BROWSERSTACK_IPA_URL,
83-
// browserName: '%browserName3',
84-
// browser_version: '%browser_version3',
85-
// real_mobile: true,
86-
// acceptSslCerts: true,
87-
// 'browserstack.console': 'info',
88-
// 'browserstack.appium_version': '%browserstack.appium_version3',
89-
// 'browserstack.local': false,
90-
// 'browser.geoLocation': 'US',
91-
// isAndroid: false,
92-
// isCordovaFromAppStore: true,
93-
// isIOS: true,
94-
// isMobileScreenSize: true,
95-
// },
96-
// {
97-
// name: 'readyMainTest: %device4%os4 %os_version4',
98-
// build: buildNameForDisplay,
99-
// device: '%device4',
100-
// os: '%os4',
101-
// os_version: '%os_version4',
102-
// app: browserStackConfig.BROWSERSTACK_IPA_URL,
103-
// browserName: '%browserName4',
104-
// browser_version: '%browser_version4',
105-
// real_mobile: true,
106-
// acceptSslCerts: true,
107-
// 'browserstack.console': 'info',
108-
// 'browserstack.appium_version': '%browserstack.appium_version4',
109-
// 'browserstack.local': false,
110-
// 'browser.geoLocation': 'US',
111-
// isAndroid: false,
112-
// isCordovaFromAppStore: true,
113-
// isIOS: true,
114-
// isMobileScreenSize: true,
115-
// },
116-
],
35+
{
36+
name: 'readyMainTest: Samsung Galaxy S20 Ultra 10.0',
37+
build: buildNameForDisplay,
38+
device: 'Samsung Galaxy S20 Ultra',
39+
os_version: '10.0',
40+
app: browserStackConfig.BROWSERSTACK_APK_URL,
41+
browserName: 'Android',
42+
real_mobile: true,
43+
'browserstack.console': 'info',
44+
'browserstack.appium_version': '1.17.0',
45+
'browserstack.local': false,
46+
isAndroid: true,
47+
isCordovaFromAppStore: true,
48+
isIOS: false,
49+
isMobileScreenSize: true,
50+
},
51+
{
52+
name: 'readyMainTest: Samsung Galaxy S8 Plus 9.0',
53+
build: buildNameForDisplay,
54+
device: 'Samsung Galaxy S8 Plus',
55+
os_version: '9.0',
56+
app: browserStackConfig.BROWSERSTACK_APK_URL,
57+
browserName: 'Android',
58+
real_mobile: true,
59+
'browserstack.console': 'info',
60+
'browserstack.appium_version': '1.17.0',
61+
'browserstack.local': false,
62+
isAndroid: true,
63+
isCordovaFromAppStore: true,
64+
isIOS: false,
65+
isMobileScreenSize: true,
66+
},
67+
],
11768
webviewConnectTimeout: 90000,
11869
baseUrl: browserStackConfig.WEB_APP_ROOT_URL,
119-
connectionRetryTimeout: 90000,
120-
connectionRetryCount: 3,
12170
reporters: ['concise'],
12271

12372
framework: 'mocha',

‎tests/browserstack/wdio.conf.template

+44-88
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Can not set browser.geoLocation and browser.local simultaneously
12
const browserStackConfig = require('./browserstack.config');
23

34
const date = new Date();
@@ -9,15 +10,15 @@ exports.config = {
910
key: browserStackConfig.BROWSERSTACK_KEY,
1011
updateJob: false,
1112
specs: [
12-
'./specs/%scriptNameMainTest.js',
13+
'./specs/%scriptMainTest.js',
1314
],
1415
twitterUserName: browserStackConfig.TWITTER_USER_NAME,
1516
twitterPassword: browserStackConfig.TWITTER_PASSWORD,
1617
voterDeviceId: '%cookie',
1718
exclude: [],
1819
capabilities: [
1920
{
20-
name: '%scriptNameMainTest: %device0%os0 %os_version0',
21+
name: '%scriptMainTest: %device0%os0 %os_version0',
2122
build: buildNameForDisplay,
2223
device: '%device0',
2324
os: '%os0',
@@ -26,106 +27,61 @@ exports.config = {
2627
browserName: '%browserName0',
2728
browser_version: '%browser_version0',
2829
real_mobile: %real_mobile,
29-
acceptSslCerts: %acceptSslCerts,
30+
resolution: '%resolution',
3031
'browserstack.console': 'info',
3132
'browserstack.appium_version': '%browserstack.appium_version0',
3233
'browserstack.local': %browserstack.local,
33-
'browser.geoLocation': '%browserstack.geoLocation',
3434
isAndroid: %isAndroid,
3535
isCordovaFromAppStore: %isCordova,
3636
isIOS: %isIOS,
3737
isMobileScreenSize: %isMobileScreenSize,
3838
},
39-
// {
40-
// name: '%scriptNameMainTest: %device1%os1 %os_version1',
41-
// build: buildNameForDisplay,
42-
// device: '%device1',
43-
// os: '%os1',
44-
// os_version: '%os_version1',
45-
// app: %app,
46-
// browserName: '%browserName1',
47-
// browser_version: '%browser_version1',
48-
// real_mobile: %real_mobile,
49-
// acceptSslCerts: %acceptSslCerts,
50-
// 'browserstack.console': 'info',
51-
// 'browserstack.appium_version': '%browserstack.appium_version1',
52-
// 'browserstack.local': %browserstack.local,
53-
// 'browser.geoLocation': '%browserstack.geoLocation',
54-
// isAndroid: %isAndroid,
55-
// isCordovaFromAppStore: %isCordova,
56-
// isIOS: %isIOS,
57-
// isMobileScreenSize: %isMobileScreenSize,
58-
// },
59-
// {
60-
// name: '%scriptNameMainTest: %device2%os2 %os_version2',
61-
// build: buildNameForDisplay,
62-
// device: '%device2',
63-
// os: '%os2',
64-
// os_version: '%os_version2',
65-
// app: %app,
66-
// browserName: '%browserName2',
67-
// browser_version: '%browser_version2',
68-
// real_mobile: %real_mobile,
69-
// acceptSslCerts: %acceptSslCerts,
70-
// 'browserstack.console': 'info',
71-
// 'browserstack.appium_version': '%browserstack.appium_version2',
72-
// 'browserstack.local': %browserstack.local,
73-
// 'browser.geoLocation': '%browserstack.geoLocation',
74-
// isAndroid: %isAndroid,
75-
// isCordovaFromAppStore: %isCordova,
76-
// isIOS: %isIOS,
77-
// isMobileScreenSize: %isMobileScreenSize,
78-
// },
79-
// {
80-
// name: '%scriptNameMainTest: %device3%os3 %os_version3',
81-
// build: buildNameForDisplay,
82-
// device: '%device3',
83-
// os: '%os3',
84-
// os_version: '%os_version3',
85-
// app: %app,
86-
// browserName: '%browserName3',
87-
// browser_version: '%browser_version3',
88-
// real_mobile: %real_mobile,
89-
// acceptSslCerts: %acceptSslCerts,
90-
// 'browserstack.console': 'info',
91-
// 'browserstack.appium_version': '%browserstack.appium_version3',
92-
// 'browserstack.local': %browserstack.local,
93-
// 'browser.geoLocation': '%browserstack.geoLocation',
94-
// isAndroid: %isAndroid,
95-
// isCordovaFromAppStore: %isCordova,
96-
// isIOS: %isIOS,
97-
// isMobileScreenSize: %isMobileScreenSize,
98-
// },
99-
// {
100-
// name: '%scriptNameMainTest: %device4%os4 %os_version4',
101-
// build: buildNameForDisplay,
102-
// device: '%device4',
103-
// os: '%os4',
104-
// os_version: '%os_version4',
105-
// app: %app,
106-
// browserName: '%browserName4',
107-
// browser_version: '%browser_version4',
108-
// real_mobile: %real_mobile,
109-
// acceptSslCerts: %acceptSslCerts,
110-
// 'browserstack.console': 'info',
111-
// 'browserstack.appium_version': '%browserstack.appium_version4',
112-
// 'browserstack.local': %browserstack.local,
113-
// 'browser.geoLocation': '%browserstack.geoLocation',
114-
// isAndroid: %isAndroid,
115-
// isCordovaFromAppStore: %isCordova,
116-
// isIOS: %isIOS,
117-
// isMobileScreenSize: %isMobileScreenSize,
118-
// },
119-
],
39+
{
40+
name: '%scriptMainTest: %device1%os1 %os_version1',
41+
build: buildNameForDisplay,
42+
device: '%device1',
43+
os: '%os1',
44+
os_version: '%os_version1',
45+
app: %app,
46+
browserName: '%browserName1',
47+
browser_version: '%browser_version1',
48+
real_mobile: %real_mobile,
49+
resolution: '%resolution',
50+
'browserstack.console': 'info',
51+
'browserstack.appium_version': '%browserstack.appium_version1',
52+
'browserstack.local': %browserstack.local,
53+
isAndroid: %isAndroid,
54+
isCordovaFromAppStore: %isCordova,
55+
isIOS: %isIOS,
56+
isMobileScreenSize: %isMobileScreenSize,
57+
},
58+
{
59+
name: '%scriptMainTest: %device2%os2 %os_version2',
60+
build: buildNameForDisplay,
61+
device: '%device2',
62+
os: '%os2',
63+
os_version: '%os_version2',
64+
app: %app,
65+
browserName: '%browserName2',
66+
browser_version: '%browser_version2',
67+
real_mobile: %real_mobile,
68+
resolution: '%resolution',
69+
'browserstack.console': 'info',
70+
'browserstack.appium_version': '%browserstack.appium_version2',
71+
'browserstack.local': %browserstack.local,
72+
isAndroid: %isAndroid,
73+
isCordovaFromAppStore: %isCordova,
74+
isIOS: %isIOS,
75+
isMobileScreenSize: %isMobileScreenSize,
76+
},
77+
],
12078
webviewConnectTimeout: 90000,
12179
baseUrl: browserStackConfig.WEB_APP_ROOT_URL,
122-
connectionRetryTimeout: %connectionRetryTimeout,
123-
connectionRetryCount: %connectionRetryCount,
12480
reporters: ['concise'],
12581

12682
framework: 'mocha',
12783
mochaOpts: {
12884
ui: 'bdd',
129-
timeout: %timeout,
85+
timeout: 360000,
13086
},
13187
}

‎wevoteserver.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Ubuntu 20.04
2+
#!/usr/bin/env bash
3+
4+
function error() { echo -e "\e[1;31m$1\e[0m"; exit -1; }
5+
function success() { echo -e "\e[1;32m$1\e[0m"; }
6+
7+
8+
echo "[*] Updating..." && sudo apt update -y >/dev/null 2>&1 && success "[+] Updated successfully" || error "[-] Failed to update"
9+
10+
echo "[*] Upgrading..." && sudo apt upgrade -y && success "[+] Upgraded successfully" || error "[-] Failed to upgrade"
11+
12+
echo "[*] Installing python dependencies..."
13+
dpkg -l python-psycog2 python-dev >/dev/null 2>&1 && success "[+] Python dependencies already installed" || (sudo apt install python-psycog2 python-dev >/dev/null 2>&1 && success "[+] Installed python dependencies" || error "[-] Failed to install python dependencies")
14+
15+
echo "[*] Installing postgresql..."
16+
dpkg -l postgresql postgresql-client postgresql-contrib >/dev/null 2>&1 && success "[+] Postgresql already installed" || (sudo apt install postgresql postgresql-contrib postgresql-client >/dev/null 2>&1 && success "[+] Installed postgresql" || error "[-] Failed to install postgresql")
17+
18+
#echo '\password postgres\n\q' | sudo -u postgres psql postgres
19+
#sudo -u postgres createdb WeVoteServerDB

0 commit comments

Comments
 (0)
Please sign in to comment.