Skip to content
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
3 changes: 1 addition & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: microsoft/playwright-github-action@v1
- name: install required packages
run: |
sudo apt-get update
sudo apt-get install libgbm1 libgbm-dev libwoff1 libopus0 libwebp6 libwebpdemux2 libenchant1c2a libgudev-1.0-0 libsecret-1-0 libhyphen0 libgdk-pixbuf2.0-0 libegl1 libgles2 libevent-2.1-6 libnotify4 libxslt1.1
sudo apt-get install php
- name: npm install
run: |
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 2.6.7
* Add REST helper into `standardActingHelpers` array #2474 by @PeterNgTr
* Add missing `--invert` option for `run-workers` command #2504 by @pablopaul
* [WebDriver][Appium] Introduce `forceRightClick` method #2485 bylsuniljaiswal01
* [Playwright] Fix setCookie` method #2491 by @bmbarker90
* [TypeScript] Update compilerOptions.target to es2017 #2483 by @shanplourde
* [Mocha] Honor reporter configuration #2465 by @trinhpham

## 2.6.6

* Puppeteer 4.0 support. Important: MockRequest helper won't work with Puppeter > 3.3
Expand Down
11 changes: 11 additions & 0 deletions docs/helpers/Appium.md
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,17 @@ I.rightClick('Click me', '.context');
- `locator` **([string][4] \| [object][6])** clickable element located by CSS|XPath|strict locator.
- `context` **([string][4]? | [object][6])** (optional, `null` by default) element located by CSS|XPath|strict locator.{{ react }} (optional, default `null`)

### forceRightClick

{{> forceRightClick }}

{{ react }}

#### Parameters

- `locator`
- `context` (optional, default `null`)

### clearField

Clears a `<textarea>` or text `<input>` element's value.
Expand Down
30 changes: 6 additions & 24 deletions docs/helpers/WebDriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -910,39 +910,21 @@ I.forceClick({css: 'nav a.login'});

This action supports [React locators](https://codecept.io/react#locators)


### forceRightClick

Perform an emulated right click on a link or a button, given by a locator.
Unlike normal right click instead of sending native event, emulates a right click with JavaScript.
This works on hidden, animated or inactive elements as well.
{{> forceRightClick }}

If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
For buttons, the "value" attribute, "name" attribute, and inner text are searched. For links, the link text is searched.
For images, the "alt" attribute and inner text of any parent links are searched.

The second parameter is a context (CSS or XPath locator) to narrow the search.

```js
// simple link
I.forceRightClick('Logout');
// button of form
I.forceRightClick('Submit');
// CSS button
I.forceRightClick('#form input[type=submit]');
// XPath
I.forceRightClick('//form/*[@type=submit]');
// link in context
I.forceRightClick('Logout', '#nav');
// using strict locator
I.forceRightClick({css: 'nav a.login'});
```

#### Parameters
This action supports [React locators](https://codecept.io/react#locators)

- `locator` **([string][19] | [object][18])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
- `context` **([string][19]? | [object][18])** (optional, `null` by default) element to search in CSS|XPath|Strict locator.

#### Parameters

- `locator`
- `context`

### grabAllWindowHandles

Expand Down
24 changes: 12 additions & 12 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Allure reporter

Enables Allure reporter.

##### Usage
#### Usage

To start please install `allure-commandline` package (which requires Java 8)

Expand All @@ -38,7 +38,7 @@ Launch Allure server and see the report like on a screenshot above:

allure serve output

##### Configuration
#### Configuration

- `outputDir` - a directory where allure reports should be stored. Standard output directory is set by default.
- `enableScreenshotDiffPlugin` - a boolean flag for add screenshot diff to report.
Expand Down Expand Up @@ -88,7 +88,7 @@ Commands affected (by default):
- `doubleClick`
- `rightClick`

##### Configuration
#### Configuration

```js
plugins: {
Expand Down Expand Up @@ -503,7 +503,7 @@ Enable it manually on each run via `-p` option:

Dumps puppeteers code coverage after every test.

##### Configuration
#### Configuration

Configuration can either be taken from a corresponding helper (deprecated) or a from plugin config (recommended).

Expand Down Expand Up @@ -556,7 +556,7 @@ Run tests with plugin enabled:

npx codeceptjs run --plugins retryFailedStep

##### Configuration:
#### Configuration:

- `retries` - number of retries (by default 5),
- `when` - function, when to perform a retry (accepts error as parameter)
Expand All @@ -575,7 +575,7 @@ Run tests with plugin enabled:
You can use step names or step prefixes ending with `*`. As such, `wait*` will match all steps starting with `wait`.
To append your own steps to ignore list - copy and paste a default steps list. Regexp values are accepted as well.

##### Example
#### Example

```js
plugins: {
Expand All @@ -589,7 +589,7 @@ plugins: {
}
```

##### Disable Per Test
#### Disable Per Test

This plugin can be disabled per test. In this case you will need to stet `I.retry()` to all flaky steps:

Expand All @@ -613,7 +613,7 @@ Initially this functionality was part of corresponding helper but has been moved

This plugin is **enabled by default**.

##### Configuration
#### Configuration

Configuration can either be taken from a corresponding helper (deprecated) or a from plugin config (recommended).

Expand Down Expand Up @@ -763,7 +763,7 @@ Run tests with plugin enabled:

npx codeceptjs run --plugins stepByStepReport

##### Configuration
#### Configuration

```js
"plugins": {
Expand Down Expand Up @@ -800,15 +800,15 @@ This plugin allows to run webdriverio services like:

A complete list of all available services can be found on [webdriverio website][15].

###### Setup
#### Setup

1. Install a webdriverio service
2. Enable `wdio` plugin in config
3. Add service name to `services` array inside wdio plugin config.

See examples below:

###### Selenium Standalone Service
#### Selenium Standalone Service

Install `@wdio/selenium-standalone-service` package, as [described here][16].
It is important to make sure it is compatible with current webdriverio version.
Expand All @@ -827,7 +827,7 @@ plugins: {

Please note, this service can be used with Protractor helper as well!

##### Sauce Service
#### Sauce Service

Install `@wdio/sauce-service` package, as [described here][17].
It is important to make sure it is compatible with current webdriverio version.
Expand Down
2 changes: 1 addition & 1 deletion lib/plugin/standardActingHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const standardActingHelpers = [
'Puppeteer',
'Playwright',
'TestCafe',
'REST'
'REST',
];

module.exports = standardActingHelpers;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeceptjs",
"version": "2.6.6",
"version": "2.6.7",
"description": "Supercharged End 2 End Testing Framework for NodeJS",
"keywords": [
"acceptance",
Expand Down
2 changes: 1 addition & 1 deletion test/helper/WebDriver_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ describe('WebDriver', function () {
await wd.see('right clicked');
});
});

describe('#pressKey, #pressKeyDown, #pressKeyUp', () => {
it('should be able to send special keys to element', async () => {
await wd.amOnPage('/form/field');
Expand Down