Skip to content

added v2 native demo #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mobile-native-v2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
report/
apps/
.env
33 changes: 33 additions & 0 deletions mobile-native-v2/android.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Constants } from './memory';
import { App } from './page_object/AndroidApp';
import { join } from 'node:path';

export default {
paths: ['features/TestMobile.feature'],
require: [
'node_modules/@qavajs/steps-wdio/index.js'
],
browser: {
logLevel: 'warn',
timeout: {
present: 5000
},
port: 4723,
capabilities: {
platformName: 'Android',
'appium:automationName': 'UiAutomator2',
'appium:app': join(process.cwd(), './apps/android.wdio.native.app.v1.0.8.apk'),
'appium:appWaitActivity': 'com.wdiodemoapp.MainActivity',
'appium:newCommandTimeout': 240,
}
},
format: [
['@qavajs/html-formatter', 'report/report.html'],
'@qavajs/console-formatter',
['junit', 'report/report.xml']
],
memory: new Constants(),
pageObject: new App(),
parallel: 1,
defaultTimeout: 30000
}
22 changes: 22 additions & 0 deletions mobile-native-v2/features/TestMobile.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Feature: Mobile Native

@mobile @android @ios
Scenario: Mobile Login
When I click 'Nav Menu > Button (Login)'
When I type 'Username@email.com' to 'Login Form > Username'
When I type 'Password' to 'Login Form > Password'
When I click 'Login Form > Login Button'
Then I expect 'Notification Popup' to be visible
Then I expect text of 'Notification Popup > Message' equals 'You are logged in!'

@mobile @ios
Scenario: Mobile Login
When I click 'Nav Menu > Button (Forms)'
When I type 'This is qavajs' to 'Form > Input Field'
When I expect text of 'Form > You Have Typed' to equal 'This is qavajs'
When I click 'Form > Switch'
And I expect 'Form > Switch On' to be visible
When I click 'Form > Dropdown'
When I type 'webdriver.io is awesome' to 'Form > Wheel'
And I click 'Form > Wheel Done'
Then I click 'Form > Button'
39 changes: 39 additions & 0 deletions mobile-native-v2/ios.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Constants } from './memory';
import { App } from './page_object/IOSApp';
import { join } from 'node:path';

export default {
paths: ['features/TestMobile.feature'],
require: [
'node_modules/@qavajs/steps-wdio/index.js'
],
browser: {
logLevel: 'warn',
timeout: {
present: 5000
},
path: '/',
port: 4723,
capabilities: {
platformName: 'iOS',
'appium:deviceName': 'iPhone 15',
'appium:platformVersion': '17.5',
'appium:orientation': 'PORTRAIT',
'appium:automationName': 'XCUITest',
'appium:app': join(
process.cwd(),
'./apps/wdiodemoapp.app'
),
'appium:newCommandTimeout': 240,
}
},
format: [
['@qavajs/html-formatter', 'report/report.html'],
'@qavajs/console-formatter',
['junit', 'report/report.xml']
],
memory: new Constants(),
pageObject: new App(),
parallel: 1,
defaultTimeout: 60000
}
1 change: 1 addition & 0 deletions mobile-native-v2/memory/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export class Constants {}
50 changes: 50 additions & 0 deletions mobile-native-v2/mobitru.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import 'dotenv/config';
import { Constants } from './memory';
import { App } from './page_object/AndroidApp';

const KEY = encodeURIComponent(process.env.API_KEY);
const BILLING_UNIT = process.env.BILLING_UNIT;
const UDID = process.env.UDID;

const credentials = `${BILLING_UNIT}:${KEY}`;
const encodedCredentials = Buffer.from(credentials).toString('base64');

export default {
paths: ['features/TestMobile.feature'],
require: [
'node_modules/@qavajs/steps-wdio/index.js',
'step_definitions/mobitru/*.js'
],
browser: {
protocol: 'https',
hostname: 'app.mobitru.com',
headers: {
Authorization: `Basic ${encodedCredentials}`
},
path: '/wd/hub',
logLevel: 'debug',
port: 443,
timeout: {
present: 5000
},
capabilities: {
platformName: 'android',
'appium:udid': UDID,
},
reuseSession: true
},
format: [
'@qavajs/console-formatter',
['junit', 'report/report.xml'],
],
memory: new Constants(),
pageObject: new App(),
parallel: 1,
defaultTimeout: 30000,
tags: '@android',
service: [{
before() {
console.log('Find and book device');
}
}]
}
Loading