@flexn/graybox v1.0.0
@flexn/graybox
Overview:
Testing environment using WebdriverIO. iOS, tvOS, Android, AndroidTV, macOS use Appium server to run and Web uses Selenium Standalone Server. Reporting is done using Allure reporter.
Setup:
- Create wdio.capabilities.js file in testable project's root folder
- Copy capabilities object from testable project's wdio.conf.js to wdio.capabilities.js
- In wdio.capabilities.js remove
...customCapabilities,
and after object addmodule.exports = { capabilities };
- In wdio.capabilities.js file change
deviceName
andplatformVersion
for iOS, tvOS and changeavd
andplatformVersion
for Android, AndroidTV. Example of wdio.capabilities.js file can be seen below
const capabilities = {
ios: [
{
platformName: 'iOS',
deviceName: 'iPhone 11',
platformVersion: '13.5',
automationName: 'XCUITest',
...(process.env.SCHEME === 'prod' && { bundleId: 'my.bundleId' }),
...(process.env.SCHEME === 'alpha' && { bundleId: 'my.bundleId.alpha' }),
},
],
tvos: [
{
platformName: 'tvOS',
deviceName: 'Apple TV',
platformVersion: '14.4',
automationName: 'XCUITest',
...(process.env.SCHEME === 'prod' && { bundleId: 'my.bundleId' }),
...(process.env.SCHEME === 'alpha' && { bundleId: 'my.bundleId.alpha' }),
},
],
android: [
{
platformName: 'Android',
avd: 'Pixel_4_API_29',
platformVersion: '10',
automationName: 'UiAutomator2',
...(process.env.SCHEME === 'prod' && {
appPackage: 'my.appPackage',
appActivity: 'my.appActivity',
}),
...(process.env.SCHEME === 'alpha' && {
appPackage: 'my.appPackage.alpha',
appActivity: 'my.appActivity.alpha',
}),
},
],
androidtv: [
{
platformName: 'Android',
avd: 'Android_TV_1080p_API_29',
platformVersion: '10',
automationName: 'UiAutomator2',
...(process.env.SCHEME === 'prod' && {
appPackage: 'my.appPackage',
appActivity: 'my.appActivity',
}),
...(process.env.SCHEME === 'alpha' && {
appPackage: 'my.appPackage.alpha',
appActivity: 'my.appActivity.alpha',
}),
},
],
macos: [
{
platformName: 'Mac',
automationName: 'Mac2',
...(process.env.SCHEME === 'prod' && { bundleId: 'my.bundleId' }),
...(process.env.SCHEME === 'alpha' && { bundleId: 'my.bundleId.alpha' }),
},
],
web: [
{
browserName: 'chrome',
},
{
browserName: 'firefox',
},
{
browserName: 'MicrosoftEdge',
},
{
browserName: 'safari',
},
],
};
module.exports = { capabilities };
- Install packages with
yarn bootstrap
- Run the application on simulators you specified previously in wdio.capabilities.js
- Run test command in testable project's root folder.
<scheme>
must be replaced with eitherprod
oralpha
Real device additional setup before running test command:
For iOS/tvOS:
- Add the following code to wdio.capabilities.js file under ios/tvos object.
<Device udid>
must be replaced by device udid. Device udid can be found under indentifier on Xcode by navigating to Window -> Devices and Simulators and selecting connected device.<Team ID>
must be replaced by Team ID. Team ID can be found using developer account. Sign in todeveloper.apple.com/account
, and click Membership in the sidebar. Team ID appears in the Membership Information section under the team name.
udid: '<Device udid>',
xcodeOrgId: '<Team ID>',
xcodeSigningId: 'iPhone Developer'
- If the first step doesn't work, then open
./node-modules/appium-webdriveragent/WebDriverAgent.xcodeproj
. Select WebDriverAgent project and select WebDriverAgentRunner (for iOS) or WebDriverAgentRunner_tvOS (for tvOS) target, then under Signing & Capabilities tab select developer team.
For Android/AndroidTV:
- Add the following code to wdio.capabilities.js file under android/androidtv object and comment
avd
property.<Device udid>
must be replaced by device udid. Device udid can be found using cmd commandadb devices
.
udid: '<Device udid>';
Running:
- ios:
yarn e2e:ios-<scheme>
- tvos:
yarn e2e:tvos-<scheme>
- android:
yarn e2e:android-<scheme>
- androidtv:
yarn e2e:androidtv-<scheme>
- macos:
yarn e2e:macos-<scheme>
- web:
yarn e2e:web-<scheme>
- all above:
yarn e2e:all-<scheme>
- generate report:
yarn report:generate
- open report:
yarn report:open
- generate and open report:
yarn report
Prerequisites running tests on macOS app:
Xcode Helper app should be enabled for Accessibility access. The app itself could be usually found at
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Agents/Xcode Helper.app
. In order to enable Accessibility access for it simply open the parent folder in Finder:
open /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Agents/
and drag & drop the Xcode Helper app to Security & Privacy -> Privacy -> Accessibility list of your System Preferences. This action must only be done once.
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
5 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
11 months ago
11 months ago
11 months ago
12 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
11 months ago
12 months ago
12 months ago
12 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago