Skip to content

Commit

Permalink
Applied linting and prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
simonradier committed Dec 5, 2022
1 parent 1b4572a commit 43adbe7
Show file tree
Hide file tree
Showing 51 changed files with 6,037 additions and 4,424 deletions.
73 changes: 36 additions & 37 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
{
"env": {
"node": true,
"mocha": true
},
//"extends": ["prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"settings": {
"import/resolver": {
"node": {
"paths": ["src"]
},
"typescript": { "paths": ["src"] }
}
},
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "variable",
"format": ["camelCase"]
}
],
"import/prefer-default-export": "off",
"sort-imports": "off",
"no-use-before-define": "off",
"object-curly-newline": "off",
"prefer-const": "error",
"comma-dangle": "off",
"no-console": ["warn", { "allow": ["warn", "error", "info"] }],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "ignoreRestSiblings": true }]
"env": {
"node": true,
"mocha": true
},
//"extends": ["prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"settings": {
"import/resolver": {
"node": {
"paths": ["src"]
},
"typescript": { "paths": ["src"] }
}
},
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "variable",
"format": ["camelCase"]
}
],
"import/prefer-default-export": "off",
"sort-imports": "off",
"no-use-before-define": "off",
"object-curly-newline": "off",
"prefer-const": "error",
"comma-dangle": "off",
"no-console": ["warn", { "allow": ["warn", "error", "info"] }],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "ignoreRestSiblings": true }]
}
}
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
version: 2
updates:
# Enable version updates for npm
- package-ecosystem: "npm"
- package-ecosystem: 'npm'
# Look for `package.json` and `lock` files in the `root` directory
directory: "/"
directory: '/'
# Check the npm registry for updates every day (weekdays)
schedule:
interval: "daily"
interval: 'daily'
33 changes: 16 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Tests & Deploy

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

workflow_dispatch:

Expand All @@ -13,13 +13,13 @@ jobs:
runs-on: ubuntu-latest

env:
COVERALLS_REPO_TOKEN: "${{ secrets.COVERALLS_REPO_TOKEN }}"
COVERALLS_GIT_BRANCH: "${{ github.ref }}"
COVERALLS_SERVICE_NAME: "Github CI"
COVERALLS_REPO_TOKEN: '${{ secrets.COVERALLS_REPO_TOKEN }}'
COVERALLS_GIT_BRANCH: '${{ github.ref }}'
COVERALLS_SERVICE_NAME: 'Github CI'

steps:
- uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2.1.4

Expand All @@ -30,13 +30,12 @@ jobs:
run: npm run prepublishOnly

- name: Launch unit testing
run: npm run test
run: npm run test

- name: Launch coverage update
if: github.ref == 'refs/heads/main'
run: npm run coverage



e2e-test:
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -54,7 +53,7 @@ jobs:
browser: edge #Not available
steps:
- uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2.1.4

Expand All @@ -66,15 +65,15 @@ jobs:

- name: Run chromedriver (ubuntu)
if: ${{ matrix.browser == 'chrome' && matrix.os == 'ubuntu-latest' }}
run: xvfb-run --auto-servernum chromedriver &
run: xvfb-run --auto-servernum chromedriver &

- name: Run chromedriver (windows)
if: ${{ matrix.browser == 'chrome' && matrix.os == 'windows-latest' }}
run: cmd /c "START chromedriver"
run: cmd /c "START chromedriver"

- name: Run chromedriver (macos)
if: ${{ matrix.browser == 'chrome' && matrix.os == 'macos-latest' }}
run: chromedriver &
run: chromedriver &

- name: Run geckodriver (ubuntu)
if: ${{ matrix.browser == 'firefox' && matrix.os == 'ubuntu-latest' }}
Expand All @@ -90,17 +89,17 @@ jobs:

- name: Run msedgedriver (windows)
if: ${{ matrix.browser == 'edge' && matrix.os == 'windows-latest' }}
run: cmd /c "START msedgedriver --port=9415"
run: cmd /c "START msedgedriver --port=9415"

- name: Run msedgedriver (macos)
if: ${{ matrix.browser == 'edge' && matrix.os == 'macos-latest' }}
run: msedgedriver --port=9415 &
run: msedgedriver --port=9415 &

- name: Run safaridriver (macos)
if: ${{ matrix.browser == 'safari' }}
run: |
sudo safaridriver --enable
safaridriver --port 9315 &
safaridriver --port 9315 &
- name: Run test with webdriver ${{ matrix.os }}-${{ matrix.browser }}
run: npm run test-wd-${{ matrix.browser }}
run: npm run test-wd-${{ matrix.browser }}
15 changes: 7 additions & 8 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"semi": false,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 90,
"tabWidth": 2,
"arrowParens": "avoid"
}

"semi": false,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 90,
"tabWidth": 2,
"arrowParens": "avoid"
}
10 changes: 5 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"mochaExplorer.files": "test/unit/**/*.ts",
"mochaExplorer.require":"ts-node/register",
"mochaExplorer.timeout": 10000,
/*"mochaExplorer.env": {
"mochaExplorer.files": "test/unit/**/*.ts",
"mochaExplorer.require": "ts-node/register",
"mochaExplorer.timeout": 10000
/*"mochaExplorer.env": {
"NOCK_OFF" : "true"
}*/
}
}
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
[![Coverage Status](https://coveralls.io/repos/github/simonradier/simple-webdriver/badge.svg?branch=refs/heads/main)](https://coveralls.io/github/simonradier/simple-webdriver?branch=refs/heads/main)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=simonradier_simple-webdriver&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=simonradier_simple-webdriver)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=simonradier_simple-webdriver&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=simonradier_simple-webdriver)

</p>

# simple-webdriver

A webdriver javascript bindings written in typescript with no dependency

# How to get started
Install the package ```simple-webdriver```
```npm install --save simple-webdriver```

Install the package `simple-webdriver`
`npm install --save simple-webdriver`
Install a W3C compatible webdriver

```
npm install --save webdriver-manager
webdriver-manager update
Expand All @@ -30,11 +34,12 @@ async function example() {
await browser.navigate().to("http://perdu.com");
let title = await browser.getTitle();
console.log(title);
}
}
example();
```

# Warning

This is an early version which should not be used in production environment. Major changes can occur before 1.0.0.
Loading

0 comments on commit 43adbe7

Please sign in to comment.