Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Rework setupaAfterEach.js to ts #5111

Closed
wants to merge 116 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
8af3be7
chore(test): move element_spec.js off of the control flow
cnishina Nov 6, 2018
f11cdf4
chore(test): cleanup async await in element_spec.js (#4999)
cnishina Nov 7, 2018
5900571
chore(test): move lib_spec.js off of the control flow (#5000)
cnishina Nov 8, 2018
4d67fed
chore(test): move handling_spec off of the control flow (#5010)
CrispusDH Nov 8, 2018
37043ca
chore(test): move navigation_spec off of the control flow (#5011)
CrispusDH Nov 8, 2018
6d36815
chore(test): clean up suite tests (#5009)
cnishina Nov 9, 2018
c957c58
chore(test): move locators_spec.js off of the control flow (#5001)
cnishina Nov 9, 2018
ae84f95
chore(test): move mockmodule_spec.js off of the control flow (#5002)
cnishina Nov 9, 2018
ea348ba
chore(test): move altRoot and inferRoot test off of the control flow …
cnishina Nov 9, 2018
4e149af
chore(test): use native promises instead of q on onPrepare (#5005)
cnishina Nov 9, 2018
8d900f9
chore(test): move plugins tests off of the control flow and remove q …
cnishina Nov 9, 2018
d4f4c09
chore(test): use native promises instead of q onCleanUp (#5004)
cnishina Nov 9, 2018
d931bcd
chore(test): move restart_spec off of the control flow (#5014)
CrispusDH Nov 9, 2018
5b7160f
chore(test): move withLogin test off of the control flow (#5008)
cnishina Nov 9, 2018
601bd53
chore(test): move expected_conditions_spec off of the control flow (#…
CrispusDH Nov 9, 2018
672f04b
chore(test): clean up mocha tests (#5007)
cnishina Nov 9, 2018
6e023e3
chore(test): move polling_spec off of the control flow (#5012)
CrispusDH Nov 9, 2018
8fd6370
chore(test): move synchronize_spec off of the control flow (#5016)
CrispusDH Nov 9, 2018
eb5913a
chore(test): clean up no control flow typescript tests (#5023)
cnishina Nov 9, 2018
ba33f08
chore(test): move controlLock test off of the control flow (#5022)
cnishina Nov 9, 2018
7b77acf
chore(test): move restartBrowserBetweenTests off of the control flow …
cnishina Nov 9, 2018
7172e48
chore(test): move interaction test off of the control flow (#5019)
cnishina Nov 9, 2018
c0855fc
chore(test): move hybrid/async_spec off of the control flow (#5024)
CrispusDH Nov 9, 2018
bf3ffba
chore(test): update provider and capabilities tests off of the contro…
cnishina Nov 10, 2018
6b3d9c0
chore(test): move custom/smoke_spec off of the control flow (#5026)
CrispusDH Nov 10, 2018
02b3cb9
chore(test): move noGlobals/noGlobals_spec off of the control flow (#…
CrispusDH Nov 10, 2018
149a2ac
chore(promises): clean up driver providers and browser control flow (…
cnishina Nov 15, 2018
51cb087
chore(promises): move locator wdpromise to native Promise (#5044)
cnishina Nov 16, 2018
beb961d
chore(promises): move element wdpromise to native Promise (#5047)
cnishina Nov 19, 2018
e458025
chore(promises): remove q promises and webdriver promises (#5052)
cnishina Nov 27, 2018
13a8668
chore(promises) move interactive_test_util off q, rework to ES6 synta…
CrispusDH Nov 27, 2018
ee73f2d
chore(promises) move test_util out of q (#5036)
CrispusDH Nov 28, 2018
708661f
chore(tests): update restart spec specs and plugin specs (#5058)
cnishina Nov 28, 2018
9f233a9
chore(jshint): remove jshint from build (#5060)
cnishina Nov 28, 2018
30d78a5
chore(promises): remove q and jasminewd (#5059)
cnishina Nov 28, 2018
fa4344d
chore(tests): remove element explorer tests and enable install tests …
cnishina Nov 29, 2018
39ed5a3
chore(tests): fix spec/ng2/timeout_spec test (#5067)
cnishina Nov 29, 2018
47abbb4
chore(test): fix attach session test (#5063)
cnishina Nov 29, 2018
e9622f4
chore(test): fix unit tests (#5064)
cnishina Nov 29, 2018
6c3c621
chore(test): error tests fixed (#5069)
cnishina Dec 1, 2018
3678185
chore(debugger): remove debugger and explore methods (#5070)
cnishina Dec 1, 2018
9b65165
chore(ignoreSynchornization): clean up to use waitForAngularEnabled (…
cnishina Dec 4, 2018
fb828ad
chore(cleanup): clean up imports and wdpromises (#5073)
cnishina Dec 4, 2018
3b7a3f7
chore(test): remove jasmine addMatcher test (#5072)
cnishina Dec 6, 2018
2f91378
deps(webdriver-manager): use replacement (#5088)
cnishina Dec 12, 2018
efa2354
deps(latest): upgrade to the gulp and typescript (#5089)
cnishina Dec 13, 2018
cbde6a7
chore(bin): update webdriver-manager require to use the cli (#5093)
cnishina Dec 15, 2018
67b3dba
typings(selenium): try out new version of typings (#5084)
cnishina Dec 15, 2018
4b4e9a9
docs(api): update examples to use async/await (#5081)
devoto13 Dec 17, 2018
6cc6435
chore(elementexplorer): remove explorer bin file (#5094)
cnishina Dec 18, 2018
9c6af73
chore(test): move element_spec.js off of the control flow
cnishina Nov 6, 2018
55acd49
chore(test): cleanup async await in element_spec.js (#4999)
cnishina Nov 7, 2018
39c1fa3
chore(test): move lib_spec.js off of the control flow (#5000)
cnishina Nov 8, 2018
662486a
chore(test): move handling_spec off of the control flow (#5010)
CrispusDH Nov 8, 2018
0933831
chore(test): move navigation_spec off of the control flow (#5011)
CrispusDH Nov 8, 2018
995c698
chore(test): clean up suite tests (#5009)
cnishina Nov 9, 2018
511104d
chore(test): move locators_spec.js off of the control flow (#5001)
cnishina Nov 9, 2018
d27e36a
chore(test): move mockmodule_spec.js off of the control flow (#5002)
cnishina Nov 9, 2018
4a9c65e
chore(test): move altRoot and inferRoot test off of the control flow …
cnishina Nov 9, 2018
9db106d
chore(test): use native promises instead of q on onPrepare (#5005)
cnishina Nov 9, 2018
9740d11
chore(test): move plugins tests off of the control flow and remove q …
cnishina Nov 9, 2018
600080a
chore(test): use native promises instead of q onCleanUp (#5004)
cnishina Nov 9, 2018
22f7337
chore(test): move restart_spec off of the control flow (#5014)
CrispusDH Nov 9, 2018
1b99562
chore(test): move withLogin test off of the control flow (#5008)
cnishina Nov 9, 2018
33e9370
chore(test): move expected_conditions_spec off of the control flow (#…
CrispusDH Nov 9, 2018
a304a62
chore(test): clean up mocha tests (#5007)
cnishina Nov 9, 2018
6b1748f
chore(test): move polling_spec off of the control flow (#5012)
CrispusDH Nov 9, 2018
f9222c9
chore(test): move synchronize_spec off of the control flow (#5016)
CrispusDH Nov 9, 2018
d2cc282
chore(test): clean up no control flow typescript tests (#5023)
cnishina Nov 9, 2018
d973327
chore(test): move controlLock test off of the control flow (#5022)
cnishina Nov 9, 2018
ad0ca9e
chore(test): move restartBrowserBetweenTests off of the control flow …
cnishina Nov 9, 2018
b623b07
chore(test): move interaction test off of the control flow (#5019)
cnishina Nov 9, 2018
f742357
chore(test): move hybrid/async_spec off of the control flow (#5024)
CrispusDH Nov 9, 2018
db652b7
chore(test): update provider and capabilities tests off of the contro…
cnishina Nov 10, 2018
3c10de4
chore(test): move custom/smoke_spec off of the control flow (#5026)
CrispusDH Nov 10, 2018
f160c57
chore(test): move noGlobals/noGlobals_spec off of the control flow (#…
CrispusDH Nov 10, 2018
915dd21
chore(promises): clean up driver providers and browser control flow (…
cnishina Nov 15, 2018
191a8e0
chore(promises): move locator wdpromise to native Promise (#5044)
cnishina Nov 16, 2018
af4a319
chore(promises): move element wdpromise to native Promise (#5047)
cnishina Nov 19, 2018
183de6b
chore(promises): remove q promises and webdriver promises (#5052)
cnishina Nov 27, 2018
865d6bc
chore(promises) move interactive_test_util off q, rework to ES6 synta…
CrispusDH Nov 27, 2018
c1e63aa
chore(promises) move test_util out of q (#5036)
CrispusDH Nov 28, 2018
22d3a4c
chore(tests): update restart spec specs and plugin specs (#5058)
cnishina Nov 28, 2018
012f1ff
chore(jshint): remove jshint from build (#5060)
cnishina Nov 28, 2018
0d978d0
chore(promises): remove q and jasminewd (#5059)
cnishina Nov 28, 2018
b488a7e
chore(tests): remove element explorer tests and enable install tests …
cnishina Nov 29, 2018
ff1c6d2
chore(tests): fix spec/ng2/timeout_spec test (#5067)
cnishina Nov 29, 2018
761d003
chore(test): fix attach session test (#5063)
cnishina Nov 29, 2018
ac34f77
chore(test): fix unit tests (#5064)
cnishina Nov 29, 2018
9bb9901
chore(test): error tests fixed (#5069)
cnishina Dec 1, 2018
356239d
chore(debugger): remove debugger and explore methods (#5070)
cnishina Dec 1, 2018
9c7165a
chore(ignoreSynchornization): clean up to use waitForAngularEnabled (…
cnishina Dec 4, 2018
4f28adc
chore(cleanup): clean up imports and wdpromises (#5073)
cnishina Dec 4, 2018
053f0dc
chore(test): remove jasmine addMatcher test (#5072)
cnishina Dec 6, 2018
424060a
deps(webdriver-manager): use replacement (#5088)
cnishina Dec 12, 2018
4dff3d3
deps(latest): upgrade to the gulp and typescript (#5089)
cnishina Dec 13, 2018
3cbbf8a
chore(bin): update webdriver-manager require to use the cli (#5093)
cnishina Dec 15, 2018
e73c101
typings(selenium): try out new version of typings (#5084)
cnishina Dec 15, 2018
cf03143
docs(api): update examples to use async/await (#5081)
devoto13 Dec 17, 2018
53df06a
chore(elementexplorer): remove explorer bin file (#5094)
cnishina Dec 18, 2018
f9281a0
chore(browser): remove timing issues with restart and fork (#5085)
cnishina Dec 18, 2018
3bf84f0
deps(selenium): upgrade to selenium 4 (#5095)
cnishina Dec 19, 2018
7654039
chore(debugprint): convert debugprint to TypeScript (#5074)
CrispusDH Dec 19, 2018
4f43d9b
merge conflicts
CrispusDH Dec 19, 2018
61913bc
return debugprint
CrispusDH Dec 19, 2018
f872aa7
chore(expectedConditions): update generic Function typings (#5101)
cnishina Dec 20, 2018
a33918a
deps(jasmine): upgrade jasmine 3.3 (#5102)
cnishina Dec 20, 2018
375daf8
chore(webdriver-manager): use [email protected]
cnishina Dec 25, 2018
205c4d8
chore(release): release 6.0.0-beta and update the changelog
cnishina Dec 25, 2018
9287f04
rework setupAfterEach.js to ts
CrispusDH Dec 28, 2018
b1b8c0d
fix linter
CrispusDH Dec 28, 2018
3862d5b
Merge branch 'selenium4' into setup-after-each-to-ts
CrispusDH Dec 28, 2018
fb41a41
fix formatter
CrispusDH Dec 28, 2018
3250cde
Merge branch 'setup-after-each-to-ts' of github.com:CrispusDH/protrac…
CrispusDH Dec 28, 2018
d6134ad
change path to setupAfterEach
CrispusDH Dec 28, 2018
d7a21c1
change import in js file
CrispusDH Dec 28, 2018
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
1 change: 0 additions & 1 deletion .jshintignore

This file was deleted.

28 changes: 0 additions & 28 deletions .jshintrc

This file was deleted.

15 changes: 8 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js
sudo: false
node_js:
- "6"
- "8"
- "9"
- "10"

env:
global:
Expand All @@ -24,9 +24,9 @@ matrix:
- env: "JOB=bstack"
exclude:
- env: JOB=smoke
node_js: "7"
node_js: "9"
- env: JOB=bstack
node_js: "7"
node_js: "9"

addons:
apt:
Expand All @@ -36,17 +36,18 @@ addons:
- g++-4.8

before_install:
- g++-4.8 --version
- travis_wait g++-4.8 --version

before_script:
- npm run install_testapp
- npm run pretest
- mkdir -p $LOGS_DIR
- ./scripts/travis_setup.sh
- travis_wait ./scripts/travis_setup.sh


script:
- ./scripts/testserver.sh
- ./scripts/test_on_travis.sh

after_script:
- ./scripts/print_logs.sh
- ./scripts/print_logs.sh
150 changes: 150 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,153 @@
# 6.0.0-beta

Selenium 4 removes the control flow and most of these changes are based on those changes. To see the full list of changes, please refer to selenium-webdriver's [CHANGELOG](https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/CHANGES.md)

## Breaking changes

- Control flow is removed and you should use async await to run your tests.
- Other control flow related items:
- debugger, explore and element explorer have been removed
- jasminewd is no longer a dependency
- ignoreSynchronization has been deprecated and you should use `waitForAngularEnabled`
- Types for selenium-webdriver are currently in the types/ directory and are not complete. We are still missing some type definitions for selenium 4.
- Actions API in selenium-webdriver have changed and they will break your test. Also we have not exported it yet since the type definitions are not complete.

## Features

- ([8420cfa](https://github.com/angular/protractor/commit/8420cfa10fa5e32b037db933d40e84726a895f3c))
chore(debugprint): convert debugprint to TypeScript (#5074)

- ([1e12445](https://github.com/angular/protractor/commit/1e124454d2926a9d2328c1a4516186f533b42b71))
chore(browser): remove timing issues with restart and fork (#5085)

- remove .ready since forking should automatically return a browser
- getNewDriver should return a promised WebDriver that can be awaited
- fix interaction tests and local driver tests
- update unit tests for async await due to getNewDriver fix
closes #5031
- ([d6bbf09](https://github.com/angular/protractor/commit/d6bbf09af0220f683ac7db51ade5cada45876776))
chore(elementexplorer): remove explorer bin file (#5094)

closes #5092

- ([0c325c5](https://github.com/angular/protractor/commit/0c325c56f0aef3b0016890b074938db875ae7a62))
chore(ignoreSynchornization): clean up to use waitForAngularEnabled (#5071)


- ([591653d](https://github.com/angular/protractor/commit/591653d46b390d5b16087b5fb5b65cc680090fed))
chore(debugger): remove debugger and explore methods (#5070)

- ([0541775](https://github.com/angular/protractor/commit/0541775980f0314fc36590eae1791f478588b619))
chore(promises): remove q promises and webdriver promises (#5052)

- remove q promises and webdriver promises from the runner, launcher, plugins, and taskRunner
- add deprecated message to element explorer.
- add unhandledRejection
- update browser versions used in travis tests

- ([7ca7df2](https://github.com/angular/protractor/commit/7ca7df2708b847b9d002bef6d1ed0fe075154aeb))
chore(promises): clean up driver providers and browser control flow (#5034)

Driver providers and tests:

- Use native promises over q promises in driver providers
- Remove driverProviderUseExistingWebDriver since the generation of the selenium server is already
accomplished when providing a selenium address in driverProvider.ts. Also clean up docs and tests.

- Enabled the driverProviderLocal tests
- Clean up JSDocs for q.promise
Basic lib spec:

- Remove auto unwrap test for a WebElement. Reference PR #3471
Browser:

- Remove control flow from waitForAngularEnabled, waitForAngular, and angularAppRoot in the
Browser class.

## Dependencies

- ([93930ff](https://github.com/angular/protractor/commit/93930fff33e94942c8ff6c6c8089dcd70acd6b7b))
deps(jasmine): upgrade jasmine 3.3 (#5102)

- ([373ba02](https://github.com/angular/protractor/commit/373ba029420a5f3f0c05bbb8f739f9fd96ac598b))
deps(selenium): upgrade to selenium 4 (#5095)

- elements workaround for WebElement.equals
- added a better unhandled rejection warning message in the launcher
control flow)bal function wrappers for mocha (these wrappers went away with
- fix the attach to session driver provider
Typing exported from Protractor:

- removed ActionSequence and EventEmitter (actions is currently missing)
- removed promise.Promise
fulfilled, filter, whener, delayed, createFlow, controlFlow, all,
Typings exported from WebDriver:

- removed attachToSession
- removed WebDriver instance methods: touchActions, call
- removed WebElement getSize and getLocation for getRect
- removed redefined global vars for testing
- In the typings, we are missing Options.setScriptTimeout method. This should not impact users
unless they are using the driver.manage() method.
Tests:

- fix element equals test
- add missing 'await' in colorList test that is causing unhandled promise rejections.
- remove control flow related tests
- disable the install test. Installing from "file:../../" is not working.
- fix the attach to session driver provider test to exit with a 1 if errors are encountered

- ([736bbf7](https://github.com/angular/protractor/commit/736bbf7df04b36d1d0fcc7383be2022aa14234b0))
deps(latest): upgrade to the gulp and typescript (#5089)

* deps(latest): upgrade to the gulp and typescript

- add in @types/loglevel and @types/yargs for webdriver-manager
- upgrade tslint clean up for tslint
supported by gulpp 4 and remove run sequence since this feature is
- remove compile to es5

- ([658a1fb](https://github.com/angular/protractor/commit/658a1fb3020ce6a2316113cbbb6f84e513158c82))
deps(webdriver-manager): use replacement (#5088)

publish a beta release of use webdriver-manager-replacement until we
webdriver-manager
closes #5087


# 5.4.2

## Features

- ([db1b638](https://github.com/angular/protractor/commit/db1b6381d463c7cecf11dece2bf9412fecbd6f4d))
feat(saucelabs): add sauceRegion support for eu datacenters (#5083)

This change allows user to define the backend region from sauce via the `sauceRegion` property,
e.g.

```js
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,
sauceRegion: 'eu',
```
Will run the test against `https://ondemand.eu-central-1.saucelabs.com:443/wd/hub/.`

```js
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,
sauceRegion: 'us',

// the default
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,
```
Will run the test against https://ondemand.saucelabs.com:443/wd/hub/

## Fixes

- ([f5dbe13](https://github.com/angular/protractor/commit/f5dbe13ad6755ae812627d8056527e351db8b34c))
fix(deps): @types/node is now a dev dependency

# 5.4.1

## Features
Expand Down
46 changes: 0 additions & 46 deletions bin/elementexplorer.js

This file was deleted.

2 changes: 1 addition & 1 deletion bin/webdriver-manager
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require('webdriver-manager');
require('webdriver-manager/dist/lib/cli');
4 changes: 3 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:6.14-browsers
- image: circleci/node:8.11-browsers
environment:
# Fix issue with selenium-server in containers.
# See http://github.com/SeleniumHQ/docker-selenium/issues/87
Expand Down Expand Up @@ -32,6 +32,8 @@ jobs:
- restore_cache:
key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }}

- run: google-chrome --version

- run:
name: NPM Install
command: |
Expand Down
34 changes: 0 additions & 34 deletions docs/server-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,37 +108,3 @@ Protractor can test directly against Chrome and Firefox without using a Selenium
- `directConnect: true` - Your test script communicates directly Chrome Driver or Firefox Driver, bypassing any Selenium Server. If this is true, settings for `seleniumAddress` and `seleniumServerJar` will be ignored. If you attempt to use a browser other than Chrome or Firefox an error will be thrown.

The advantage of directly connecting to browser drivers is that your test scripts may start up and run faster.

Re-using an Existing WebDriver
------------------------------

The use case for re-using an existing WebDriver is when you have existing
`selenium-webdriver` code and are already in control of how the WebDriver is
created, but would also like Protractor to use the same browser, so you can
use protractor's element locators and the rest of its API. This could be
done with the `attachSession` driver provider, but the `attachSession` API is
being removed in `selenium-webdriver` 4.0.0.

Instead of a protractor config file, you create a config object in your test
setup code, and add your already-created WebDriver object and base URL.

```javascript
const ProtractorConfigParser = require('protractor/built/configParser').ConfigParser;
const ProtractorRunner = require('protractor/built/runner').Runner;

const ptorConfig = new ProtractorConfigParser().config_;
ptorConfig.baseUrl = myExistingBaseUrl;
ptorConfig.seleniumWebDriver = myExistingWebDriver;
ptorConfig.noGlobals = true; // local preference

// looks similar to protractor/built/runner.js run()
const ptorRunner = new ProtractorRunner(ptorConfig);
ptorRunner.driverProvider_.setupEnv();
const browser = ptorRunner.createBrowser();
ptorRunner.setupGlobals_(browser); // now you can access protractor.$, etc.
```

Note that this driver provider leaves you in control of quitting the driver,
but that also means Protractor API calls that expect the driver to properly
quit and/or restart the browser, e.g. `restart`, `restartSync`, and
`forkNewDriverInstance`, will not behave as documented.
Loading