Skip to content

Commit

Permalink
Merge pull request #8 from gemini-testing/rebranding
Browse files Browse the repository at this point in the history
chore: hermione -> testplane
  • Loading branch information
KuznetsovRoman committed Apr 8, 2024
2 parents 57c9d91 + 0dd9c2e commit d63e498
Show file tree
Hide file tree
Showing 6 changed files with 1,514 additions and 12,984 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# hermione-tabs-closer
# @testplane/tabs-closer

Plugin for hermione to close opened tabs from previous tests in a browser. When your tests are opening a lot of tabs in one session, browser can degrade. So that's why you need to close opened tabs before test execution.
Plugin for Testplane to close opened tabs from previous tests in a browser. When your tests are opening a lot of tabs in one session, browser can degrade. So that's why you need to close opened tabs before test execution.

## Installation

```bash
npm install hermione-tabs-closer
npm install @testplane/tabs-closer
```

## Usage
Expand All @@ -17,18 +17,18 @@ 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_tabs_closer_` prefix for the environment variables and `--hermione-tabs-closer-` for the cli options.
Use `testplane_tabs_closer_` prefix for the environment variables and `--testplane-tabs-closer-` for the cli options.

### Hermione usage
### Testplane usage

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

```js
module.exports = {
// ...
system: {
plugins: {
'hermione-tabs-closer': {
'@testplane/tabs-closer': {
enabled: true,
browsers: /chrome/
}
Expand Down
4 changes: 2 additions & 2 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const _ = require('lodash');
const {root, section, option} = require('gemini-configparser');

const ENV_PREFIX = 'hermione_tabs_closer_';
const CLI_PREFIX = '--hermione-tabs-closer-';
const ENV_PREFIX = 'testplane_tabs_closer_';
const CLI_PREFIX = '--testplane-tabs-closer-';

const getParser = () => {
return root(section({
Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const Promise = require('bluebird');
const parseConfig = require('./config');

module.exports = (hermione, opts = {}) => {
if (!hermione.isWorker()) {
module.exports = (testplane, opts = {}) => {
if (!testplane.isWorker()) {
return;
}

Expand All @@ -31,12 +31,12 @@ module.exports = (hermione, opts = {}) => {
}

function shouldClose(browserId) {
const browserConf = hermione.config.forBrowser(browserId);
const browserConf = testplane.config.forBrowser(browserId);

return pluginConfig.browsers.test(browserId) && browserConf.testsPerSession !== 1;
}

hermione.on(hermione.events.AFTER_TESTS_READ, (collection) => {
testplane.on(testplane.events.AFTER_TESTS_READ, (collection) => {
collection.eachRootSuite((root, browserId) => {
if (shouldClose(browserId)) {
root.beforeEach(async function() {
Expand Down
Loading

0 comments on commit d63e498

Please sign in to comment.