-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathtest-install
More file actions
executable file
·43 lines (29 loc) · 805 Bytes
/
test-install
File metadata and controls
executable file
·43 lines (29 loc) · 805 Bytes
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
#!/bin/bash
# Use this file to test the install.
PROJECT_DIR=$(dirname $(readlink -f ${BASH_SOURCE[0]}))
#Perform a sanity check on the published module to verify that it works.
tmpDir=/tmp/webdriver-sync
tmpWdDir=$tmpDir/node_modules/webdriver-sync
testFile=$tmpDir/test.js
rm -rf $HOME/.webdriver-sync
rm -rf $tmpDir 2> /dev/null
mkdir -p $tmpWdDir
cp -r $PROJECT_DIR/* $tmpWdDir
cd $tmpWdDir
echo 'running npm install'
rm -rf ./node_modules
npm install --production
cd $tmpDir
cat > $testFile <<~
var wd = require('webdriver-sync');
var driver;
var el;
wd.exportTo(global);
driver = new ChromeDriver();
driver.get('http://google.com');
el = driver.findElement(By.name('q'));
el.sendKeys('asdfasdf', Keys.SPACE);
el.submit();
setTimeout(function(){driver.quit();}, 1000);
~
node $testFile