Skip to content

Commit

Permalink
fix: Remove appium from dev dependencies (#1417)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Jun 21, 2022
1 parent 054d7a5 commit 42af554
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 111 deletions.
29 changes: 27 additions & 2 deletions ci-jobs/templates/ios-e2e-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,34 @@ jobs:
- task: NodeTool@0
inputs:
versionSpec: 16.x
- script: npm install
- script: |
npm install -g appium@next
npm install
displayName: Install node dependencies
- script: export PATH="${PATH}:$(python -c 'import site; print(site.USER_BASE)')/bin" && ${{ parameters.script }}
- script: |
export APPIUM_TEST_SERVER_PORT=4567
export APPIUM_TEST_SERVER_HOST=127.0.0.1
export cwd=$(pwd)
pushd "$cwd"
cd ~
appium driver install --source=local "$cwd"
appium server \
--port=$APPIUM_TEST_SERVER_PORT \
--address=$APPIUM_TEST_SERVER_HOST \
--relaxed-security \
&
popd
secondsStarted=$(date +%s)
while ! nc -z $APPIUM_TEST_SERVER_HOST $APPIUM_TEST_SERVER_PORT; do
sleep 0.1
secondsElapsed=$(( $(date +%s) - secondsStarted ))
if [[ $secondsElapsed -gt 30 ]]; then
echo "Appium server was unable to start within 30 seconds timeout"
exit 1
fi
done
export PATH="${PATH}:$(python -c 'import site; print(site.USER_BASE)')/bin" && ${{ parameters.script }}
displayName: Run functional tests
- task: PublishTestResults@2
condition: always()
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"appium-idb": "^1.0.0",
"appium-ios-device": "^2.4.0",
"appium-ios-simulator": "^4.0.0",
"appium-remote-debugger": "^9.0.0",
"appium-webdriveragent": "^4.6.0",
"appium-remote-debugger": "^9.1.1",
"appium-webdriveragent": "^4.6.1",
"appium-xcode": "^4.0.0",
"async-lock": "^1.0.0",
"asyncbox": "^2.3.1",
Expand Down Expand Up @@ -121,8 +121,6 @@
"@appium/eslint-config-appium": "^6.0.0",
"@appium/test-support": "^1.0.0",
"@semantic-release/git": "^10.0.1",
"appium": "^2.0.0-beta.40",
"appium-xcuitest-driver": "file:.",
"axios": "^0.x",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
Expand Down
3 changes: 1 addition & 2 deletions test/functional/device/performance-e2e-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import B from 'bluebird';
import { UICATALOG_CAPS } from '../desired';
import { initSession, deleteSession, getServer, MOCHA_TIMEOUT } from '../helpers/session';
import { initSession, deleteSession, MOCHA_TIMEOUT } from '../helpers/session';


chai.should();
Expand All @@ -22,7 +22,6 @@ describe('XCUITestDriver - performance', function () {
}

driver = await initSession(UICATALOG_CAPS);
getServer().driver.relaxedSecurityEnabled = true;
});
after(async function () {
await deleteSession();
Expand Down
22 changes: 4 additions & 18 deletions test/functional/helpers/session.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
import { remote } from 'webdriverio';
import { startServer } from '../../server';

const HOST = '127.0.0.1';
const PORT = 4994;
const HOST = process.env.APPIUM_TEST_SERVER_HOST || '127.0.0.1';
const PORT = parseInt(process.env.APPIUM_TEST_SERVER_PORT, 10) || 4567;
// on CI the timeout needs to be long, mostly so WDA can be built the first time
const MOCHA_TIMEOUT = 60 * 1000 * (process.env.CI ? 8 : 4);

let driver, server;

function getServer () {
return server;
}
let driver;

async function initSession (caps, remoteOpts = {}) {
server = await startServer(PORT, HOST);

driver = await remote({
hostname: HOST,
port: PORT,
Expand All @@ -35,13 +28,6 @@ async function deleteSession () {
} finally {
driver = undefined;
}

try {
await server.close();
} catch (ign) {
} finally {
server = undefined;
}
}

export { initSession, deleteSession, getServer, HOST, PORT, MOCHA_TIMEOUT };
export { initSession, deleteSession, HOST, PORT, MOCHA_TIMEOUT };
77 changes: 0 additions & 77 deletions test/functional/parallel/parallel-simulators-e2e-specs.js

This file was deleted.

8 changes: 0 additions & 8 deletions test/server.js

This file was deleted.

0 comments on commit 42af554

Please sign in to comment.