Skip to content

Commit

Permalink
Use chrome for testing (#2726)
Browse files Browse the repository at this point in the history
---------

Signed-off-by: Zabil Cheriya Maliackal <[email protected]>
Signed-off-by: Nivedha <[email protected]>
Co-authored-by: Nivedha <[email protected]>
  • Loading branch information
zabil and NivedhaSenthil authored May 24, 2024
1 parent 532c62c commit 296d4a6
Show file tree
Hide file tree
Showing 37 changed files with 13,699 additions and 20,616 deletions.
7 changes: 5 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
],
"rules": {
"prettier/prettier": [
"error"
"error",
{
"endOfLine": "auto"
}
],
"no-control-regex": 0,
"no-instanceof/no-instanceof": [
Expand Down Expand Up @@ -61,4 +64,4 @@
"curly": 2,
"require-atomic-updates": 0
}
}
}
28 changes: 14 additions & 14 deletions .github/workflows/taiko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: ['16']
node_version: ['20']
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -50,8 +50,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: ['16']
os: [ubuntu-latest, windows-latest]
node_version: ['20']
os: [ubuntu-latest]
include:
- os: windows-latest
node_version: '16'
steps:
- uses: actions/checkout@v2
- name: Use NodeJS ${{ matrix.node_version }}
Expand Down Expand Up @@ -97,10 +100,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use NodeJS 16
- name: Use NodeJS 20
uses: actions/setup-node@v1
with:
node-version: 16
node-version: 20
- name: install browser dependencies
run: |
sudo apt-get update
Expand All @@ -115,7 +118,7 @@ jobs:
libgtk-3-0 \
libdrm-dev \
libgbm-dev \
libasound-dev
libasound-dev
- name: install xvfb
run: sudo apt install xvfb
- name: functional-tests-headful
Expand All @@ -128,7 +131,7 @@ jobs:
if: failure()
with:
name: ft-reports-linux-headful
path: test/functional-tests/reports/html-report
path: test/functional-tests/reports/html-report
- name: Upload logs
uses: actions/upload-artifact@v1
if: failure()
Expand All @@ -139,16 +142,13 @@ jobs:
docs-tests:
needs: unit-tests
name: Docs tests - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use NodeJS 16
- name: Use NodeJS 20
uses: actions/setup-node@v1
with:
node-version: '16'
node-version: '20'
- name: install
run: npm install
- name: install browser dependencies
Expand All @@ -174,7 +174,7 @@ jobs:
if: failure()
with:
name: docs-tests-reports-${{ matrix.os }}
path: test/docs-tests/gauge/reports/html-report
path: test/docs-tests/gauge/reports/html-report
- name: Upload logs
uses: actions/upload-artifact@v1
if: failure()
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/update_chromium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ name: update-chromium
on:
schedule:
# cron job that will run 1st and 15th of every month by 12am
- cron: '0 12 1,15 * *'
- cron: '0 12 1,15 * *'

jobs:
update-to-latest-chromium:

runs-on: ubuntu-latest

steps:
Expand All @@ -16,7 +15,7 @@ jobs:
- name: Use NodeJS 16
uses: actions/setup-node@v1
with:
node-version: '16'
node-version: '20'

- name: Setup
run: |
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ docs/layout/partials/content.html
#local chromium
.local-chromium

#asdf tool-version
.tool-versions

#test report
test/functional-tests/reports/
test/functional-tests/.gauge/
test/functional-tests/package-lock.json
test/unit-tests/data/*.html

examples/package-lock.json
Expand Down
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

19 changes: 9 additions & 10 deletions docs/configuring_taiko.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ for specific uses cases

Taiko lets you specify certain Environment variables to customize its behaviour

* `TAIKO_ENABLE_ACTION_OUTPUT` - set to `true` to print output of each action. It's set to `true` by default with Taiko runner and in REPL mode.
* `TAIKO_SKIP_CHROMIUM_DOWNLOAD` - set to `true` to skip downloading chromium
* `TAIKO_HIGHLIGHT_ON_ACTION` - set to `false` to turn off highlighting the element on action
* `TAIKO_CHROMIUM_URL` - set to host url of mirror to download chromium
* `TAIKO_BROWSER_PATH` - set to launch browser from different location
* `TAIKO_BROWSER_ARGS` - set ',' separated browser command line switches to launch browser with extra args
* `TAIKO_EMULATE_DEVICE` - set to device model to emulate device view port
* `TAIKO_EMULATE_NETWORK` - set to the network type for Taiko to simulate. Available options are GPRS, Regular2G, Good2G, Regular3G, Good3G, Regular4G, DSL, WiFi, Offline
* `TAIKO_PLUGIN` - set to the plugin which you want Taiko to load. Takes comma separated values.
* `TAIKO_SKIP_DOCUMENTATION` - set to skip API documentation generation during install.
- `TAIKO_ENABLE_ACTION_OUTPUT` - set to `true` to print output of each action. It's set to `true` by default with Taiko runner and in REPL mode.
- `TAIKO_SKIP_CHROMIUM_DOWNLOAD` - set to `true` to skip downloading chromium
- `TAIKO_HIGHLIGHT_ON_ACTION` - set to `false` to turn off highlighting the element on action
- `TAIKO_BROWSER_PATH` - set to launch browser from different location
- `TAIKO_BROWSER_ARGS` - set ',' separated browser command line switches to launch browser with extra args
- `TAIKO_EMULATE_DEVICE` - set to device model to emulate device view port
- `TAIKO_EMULATE_NETWORK` - set to the network type for Taiko to simulate. Available options are GPRS, Regular2G, Good2G, Regular3G, Good3G, Regular4G, DSL, WiFi, Offline
- `TAIKO_PLUGIN` - set to the plugin which you want Taiko to load. Takes comma separated values.
- `TAIKO_SKIP_DOCUMENTATION` - set to skip API documentation generation during install.
2 changes: 1 addition & 1 deletion examples/01-file_upload.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { goto, fileField, button, above, attach, click, text } = require('taiko'),
path = require('path'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browserLauncher'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browser/launcher'),
expect = require('chai').expect;

(async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/02-file_download.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { goto, client, click } = require('taiko'),
path = require('path'),
fs = require('fs'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browserLauncher'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browser/launcher'),
expect = require('chai').expect;

(async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/03-work-with-frames.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { goto, text } = require('taiko'),
path = require('path'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browserLauncher'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browser/launcher'),
expect = require('chai').expect;

(async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/04-windows-tabs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { goto, click, title, closeTab, currentURL, text } = require('taiko'),
path = require('path'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browserLauncher'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browser/launcher'),
expect = require('chai').expect;

(async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/05-dropdown.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { goto, dropDown } = require('taiko'),
path = require('path'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browserLauncher'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browser/launcher'),
expect = require('chai').expect;

(async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/06-basic-auth.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { goto, text } = require('taiko'),
path = require('path'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browserLauncher'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browser/launcher'),
expect = require('chai').expect;

(async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/07-dynamic-loading.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { goto, click, text } = require('taiko'),
path = require('path'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browserLauncher'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browser/launcher'),
expect = require('chai').expect;

(async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/08-contenteditable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { goto, below, textBox, write, into } = require('taiko'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browserLauncher'),
{ openBrowserAndStartScreencast, closeBrowserAndStopScreencast } = require('./browser/launcher'),
path = require('path'),
expect = require('chai').expect;
const cwd = process.cwd();
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This folder contains samples inspired by some of selenium tips published by [ele

`npm test` runs the examples under a headless chromium.

> **Note:** The examples use `openBrowserAndStartScreencast` and `closeBrowserAndStopScreencast` from [`browserLauncher`](browserLauncher.js) instead of `openBrowser` and `closeBrowser` directly. This is to capture screen recordings. The `browserLauncher` methods can be substituted with `openBrowser` and `closeBrowser` if there is no need for screencast capture.
> **Note:** The examples use `openBrowserAndStartScreencast` and `closeBrowserAndStopScreencast` from [`browserLauncher`](browser/launcher.js) instead of `openBrowser` and `closeBrowser` directly. This is to capture screen recordings. The `browserLauncher` methods can be substituted with `openBrowser` and `closeBrowser` if there is no need for screencast capture.
### Run Options

Expand Down
2 changes: 1 addition & 1 deletion examples/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var server = app.listen(3000, async () => {
var examples = glob
.sync('*.js')
.filter(
(f) => __filename !== path.resolve(f) && 'browserLauncher.js' !== f && f.startsWith(prefix),
(f) => __filename !== path.resolve(f) && 'browser/launcher.js' !== f && f.startsWith(prefix),
)
.map((f) => {
return { file: f, task: () => run(f) };
Expand Down
Loading

0 comments on commit 296d4a6

Please sign in to comment.