-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsoultracker.js
75 lines (63 loc) · 2.43 KB
/
soultracker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* Created by wwwgift on 2/15/2019.
*/
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const wdio = require('webdriverio');
const path = require('path');
const csv = require('csvtojson');
function loadData() {
return __awaiter(this, void 0, void 0, function* () {
return csv().fromFile('../data/soultrackerdata.csv');
});
}
exports.loadData = loadData;
function getClient() {
const webDriver = require('selenium-webdriver');
//to load chrome driver
require('chromedriver');
let By = webDriver.By;
// open chrome browser
let driver = new webDriver.Builder().forBrowser('chrome').build();
}
exports.getClient = getClient;
const MAX_WAIT_TIME = 70000;
async function openchrome(client){
return client
await .get('http://www.christembassysoultracker.org');
await .findElement(By.id('id_email')).sendKeys('[email protected]');
await .findElement(By.id('id_password')).sendKeys('chemistry')
await .findElement(By.id('id_password')).sendKeys('\uE004')
await .findElement(By.id('id_password')).sendKeys("Enter")
}
async function follow(client,dt){
return __awaiter(this, void 0, void 0, function* ()
{
if(dt.gender=='female'){
var gd
gd=' Female'
}else gd='Male Female'
return client
});
}
//exports.register = register;
exports.follow = follow;
function element(id) {
return 'android=new UiSelector().resourceId("' + id + '")';
}
function elementtext(text) {
var selector = 'new UiSelector().text("'+ text +'").className("android.widget.Button")';
return 'android=' + selector;
}
function elementtext2(text) {
var selector = 'new UiSelector().text("'+ text +'")';
return 'android=' + selector;
}