init appium

This commit is contained in:
GleidsonDaniel 2022-04-01 12:33:15 -03:00 committed by Diego Mello
parent 8043ca2cf9
commit 45cf5778cb
5 changed files with 8753 additions and 0 deletions

12
appium/babel.config.js Normal file
View File

@ -0,0 +1,12 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: '14'
}
}
]
]
};

8661
appium/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

24
appium/package.json Normal file
View File

@ -0,0 +1,24 @@
{
"name": "rocket-chat-appium",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@wdio/cli": "^7.19.3",
"chai": "^4.3.6",
"webdriverio": "^7.19.3"
},
"devDependencies": {
"@babel/register": "^7.17.7",
"@wdio/appium-service": "^7.19.1",
"@wdio/local-runner": "^7.19.3",
"@wdio/mocha-framework": "^7.19.3",
"@wdio/spec-reporter": "^7.19.1",
"wdio-wait-for": "^2.2.5"
}
}

View File

@ -0,0 +1,23 @@
const { expect } = require('chai');
describe('Simple App testing', () => {
beforeEach(() => {
$('~app-root').waitForDisplayed(10000, false);
});
it('Login test: valid case', async => {
$('~username').setValue('codemagic');
$('~password').setValue('nevercode');
$('~login').click();
$('~loginstatus').waitForDisplayed(11000);
const status = $('~loginstatus').getText();
expect(status).to.equal('success');
});
it('Login test: invalid case', async => {
$('~username').setValue('nevercode');
$('~password').setValue('codemagic');
$('~login').click();
$('~loginstatus').waitForDisplayed(11000);
const status = $('~loginstatus').getText();
expect(status).to.equal('fail');
});
});

33
appium/wdio.conf.js Normal file
View File

@ -0,0 +1,33 @@
exports.config = {
services: ['appium'],
port: 4723,
runner: 'local',
specs: ['./tests/specs/**/*.js'],
path: '/wd/hub/',
capabilities: [
{
maxInstances: 1,
browserName: '',
appiumVersion: '1.22.3',
// app: 'android-official-release.apk',
platformName: 'Android',
platformVersion: '11',
deviceName: 'emulator',
automationName: 'UiAutomator2',
appPackage: 'chat.rocket.reactnative',
appActivity: 'chat.rocket.reactnative.MainActivity'
}
],
logLevel: 'trace',
bail: 0,
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
timeout: 60000
}
};