Skip to content

Commit

Permalink
Merge pull request #27 from gemini-testing/rebranding
Browse files Browse the repository at this point in the history
chore: hermione -> testplane
  • Loading branch information
KuznetsovRoman authored Apr 8, 2024
2 parents 17e8f02 + 2b203ee commit a0f421e
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 83 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The following authors have created the source code of "hermione-safari-commands"
The following authors have created the source code of "@testplane/safari-commands"
published and distributed by YANDEX LLC as the owner:

Dmitriy Dudkevich <[email protected]>
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ New contributions are welcomed. Follow this guide if you want to make one.

Follow [Github guide](https://help.github.com/articles/creating-a-pull-request) to fork a repo and create a pull request.

All bug fixes and new features should go to the [`master`](https://github.com/gemini-testing/hermione-safari-commands/tree/master) branch.
All bug fixes and new features should go to the [`master`](https://github.com/gemini-testing/testplane-safari-commands/tree/master) branch.

## Commit messages

Expand Down Expand Up @@ -36,7 +36,7 @@ If you are fixing the bug, add a test that fails without your patch and passes w

When submitting an issue please do following:

1. [Search](https://github.com/gemini-testing/hermione-safari-commands/issues) for same issues on github in order to prevent duplicates
1. [Search](https://github.com/gemini-testing/testplane-safari-commands/issues) for same issues on github in order to prevent duplicates
2. Provide the most detailed issue description so we will additional info to work with

Note that if no response for contributors questions will be provided in 1 week then issue may be considered as irrelevant/resolved and may be closed.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# hermione-safari-commands
# @testplane/safari-commands

[![NPM version](https://img.shields.io/npm/v/hermione-safari-commands.svg?style=flat)](https://www.npmjs.org/package/hermione-safari-commands)
[![Build Status](https://travis-ci.org/gemini-testing/hermione-safari-commands.svg?branch=master)](https://travis-ci.org/gemini-testing/hermione-safari-commands)
[![NPM version](https://img.shields.io/npm/v/@testplane/safari-commands.svg?style=flat)](https://www.npmjs.org/package/@testplane/safari-commands)
[![Build Status](https://travis-ci.org/gemini-testing/testplane-safari-commands.svg?branch=master)](https://travis-ci.org/gemini-testing/testplane-safari-commands)

Plugin for [hermione](https://github.com/gemini-testing/hermione) which is intended to add/wrap browser commands in order to work properly with the iOS safari browser.
Plugin for [Testplane](https://github.com/gemini-testing/testplane) which is intended to add/wrap browser commands in order to work properly with the iOS safari browser.

You can read more about hermione plugins [here](https://github.com/gemini-testing/hermione#plugins).
You can read more about Testplane plugins [here](https://github.com/gemini-testing/testplane#plugins).

## Installation

```bash
npm install hermione-safari-commands
npm install @testplane/safari-commands
```

## Usage
Expand All @@ -34,16 +34,16 @@ Plugin has following configuration:

Also there is ability to override plugin parameters by CLI options or environment variables
(see [configparser](https://github.com/gemini-testing/configparser)).
Use `hermione_safari_commands_` prefix for the environment variables and `--hermione-safari-commands-` for the cli options.
Use `testplane_safari_commands_` prefix for the environment variables and `--testplane-safari-commands-` for the cli options.

Add plugin to your `hermione` config file:
Add plugin to your `testplane` config file:

```js
module.exports = {
// ...
system: {
plugins: {
'hermione-safari-commands': {
'@testplane/safari-commands': {
enabled: true,
browsers: {
safari13: {
Expand Down Expand Up @@ -82,9 +82,9 @@ module.exports = {
### Existing safari commands:

Wrappers over existing commands:
* **url** - wrapper over wdio "url" in order to wait until the page is completely open (used timeout from [`hermione.pageLoadTimeout`](https://github.com/gemini-testing/hermione#pageloadtimeout) or `30000` ms). In [appium-xcuitest-driver](https://github.com/appium/appium-xcuitest-driver) page is open with using the `xcrun` utility - `xcrun simctl openurl` which just tells the simulator to open the page and does not wait anything;
* **url** - wrapper over wdio "url" in order to wait until the page is completely open (used timeout from [`testplane.pageLoadTimeout`](https://github.com/gemini-testing/testplane#pageloadtimeout) or `30000` ms). In [appium-xcuitest-driver](https://github.com/appium/appium-xcuitest-driver) page is open with using the `xcrun` utility - `xcrun simctl openurl` which just tells the simulator to open the page and does not wait anything;
* **click** - replaces wdio "click" in order to perform real touch click (by default it emits only events on passed element). Should be used with **touch** command;
* **screenshot** - wrapper of wdio "screenshot" in order to cut the native elements from the final image ([calibration](https://github.com/gemini-testing/hermione#calibrate) must be turned off);
* **screenshot** - wrapper of wdio "screenshot" in order to cut the native elements from the final image ([calibration](https://github.com/gemini-testing/testplane#calibrate) must be turned off);
* **orientation** - wrapper of wdio "orientation" in order to recalculate size of native elements for "screenshot" command (turns on automatically when you specify a screenshot command);
* **swipe** - replaces wdio "swipe" in order to perform swipe by coordinates in native context;
* **touch** - replaces wdio "touch" in order to perform touch click by coordinates in native context;
Expand Down
4 changes: 2 additions & 2 deletions lib/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const thr = (str) => {

const {root, map, section, option} = configParser;

const ENV_PREFIX = 'hermione_safari_commands_';
const CLI_PREFIX = '--hermione-safari-commands-';
const ENV_PREFIX = 'testplane_safari_commands_';
const CLI_PREFIX = '--testplane-safari-commands-';

const assertType = (name, validationFn, type) => {
return (v) => !validationFn(v) && thr(`"${name}" option must be ${type}, but got ${typeof v}`);
Expand Down
14 changes: 7 additions & 7 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ const {WEB_VIEW_CTX} = require('./command-helpers/test-context');
const {getNativeLocators} = require('./native-locators');
const {getElementUtils} = require('./command-helpers/element-utils');

module.exports = (hermione, opts) => {
module.exports = (testplane, opts) => {
const pluginConfig = parseConfig(opts);

if (!pluginConfig.enabled) {
return;
}

if (!hermione.isWorker()) {
hermione.on(hermione.events.SESSION_START, async (browser, {browserId}) => {
if (!testplane.isWorker()) {
testplane.on(testplane.events.SESSION_START, async (browser, {browserId}) => {
if (_.isEmpty(getBrowserPluginCfg(pluginConfig, browserId))) {
return;
}
Expand All @@ -37,14 +37,14 @@ module.exports = (hermione, opts) => {
return;
}

hermione.on(hermione.events.NEW_BROWSER, (browser, {browserId}) => {
testplane.on(testplane.events.NEW_BROWSER, (browser, {browserId}) => {
const {commands = [], nativeElementsSize} = getBrowserPluginCfg(pluginConfig, browserId);

if (_.isEmpty(commands)) {
return;
}

const broConfig = hermione.config.forBrowser(browserId);
const broConfig = testplane.config.forBrowser(browserId);

if (commands.includes('screenshot') && !commands.includes('orientation')) {
commands.push('orientation');
Expand All @@ -61,13 +61,13 @@ module.exports = (hermione, opts) => {
});
});

hermione.on(hermione.events.AFTER_TESTS_READ, (collection) => {
testplane.on(testplane.events.AFTER_TESTS_READ, (collection) => {
collection.eachRootSuite((root, browserId) => {
if (_.isEmpty(getBrowserPluginCfg(pluginConfig, browserId))) {
return;
}

const {testsPerSession} = hermione.config.forBrowser(browserId);
const {testsPerSession} = testplane.config.forBrowser(browserId);
const isTestRunsInOneSession = testsPerSession === 1;

if (isTestRunsInOneSession) {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hermione-safari-commands",
"version": "2.1.0",
"description": "Plugin for hermione to add/wrap browser commands for iOS safari",
"name": "@testplane/safari-commands",
"version": "0.0.1",
"description": "Plugin for Testplane to add/wrap browser commands for iOS safari",
"main": "lib/index.js",
"scripts": {
"lint": "eslint .",
Expand All @@ -14,9 +14,10 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/gemini-testing/hermione-safari-commands.git"
"url": "git+https://github.com/gemini-testing/testplane-safari-commands.git"
},
"keywords": [
"testplane",
"hermione",
"plugin",
"safari",
Expand All @@ -25,9 +26,9 @@
"author": "Dmitriy Dudkevich <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/gemini-testing/hermione-safari-commands/issues"
"url": "https://github.com/gemini-testing/testplane-safari-commands/issues"
},
"homepage": "https://github.com/gemini-testing/hermione-safari-commands#readme",
"homepage": "https://github.com/gemini-testing/testplant-safari-commands#readme",
"dependencies": {
"gemini-configparser": "^1.3.0",
"lodash": "^4.17.15",
Expand Down
Loading

0 comments on commit a0f421e

Please sign in to comment.