Skip to content

Instantly share code, notes, and snippets.

@MichalBryxi
Created June 26, 2020 22:20
Show Gist options
  • Save MichalBryxi/f107319d27cde38cfffacd6815f587e8 to your computer and use it in GitHub Desktop.
Save MichalBryxi/f107319d27cde38cfffacd6815f587e8 to your computer and use it in GitHub Desktop.
~/Projects/faltest feat/281-rules-format
❯ yarn test
yarn run v1.17.3
$ ./scripts/run.js packages test
packages/browser
$ mocha --recursive --exit
Packages | Browser | Test | Acceptance | Api-Verification
✓ isEnabled (101ms)
✓ waitForEnabled (55ms)
✓ waitForDisabled
✓ isDisplayed
✓ waitForVisible
✓ waitForHidden
✓ isExisting
✓ waitForInsert
✓ waitForDestroy
Packages | Browser | Test | Acceptance | resolve
✓ is as flawed as we expect (119ms)
Packages | Browser | Test | Acceptance | Browser
verify ambiguous behaviour
✓ the concept of "existing" with multiple elements (110ms)
error handling
find
✓ shows an appropriate error message
✓ cascades error messages for custom methods
✓ cascades error messages for function selectors plus args
resolve
✓ shows an appropriate error message
✓ cascades error messages for function selector parent
✓ cascades error messages for function selector child
✓ shows index for an array item from a class selector
Packages | Browser | Test | Acceptance | Redact-Password
same log level
✓ verifies our expectations are correct of what should be caught (139ms)
✓ hides any passwords from logs (132ms)
✓ also hide empty strings (110ms)
✓ hides any passwords from error messages
more permissive log level
✓ verifies our expectations are correct of what should be caught (173ms)
✓ hides any passwords from logs (158ms)
✓ also hide empty strings (122ms)
✓ hides any passwords from error messages
26 passing (13s)
packages/chai
$ mocha --recursive
Packages | Chai | Test | Integration | Index
url
normal
pass
✓ works
fail
✓ works
negated
pass
✓ works
fail
✓ works
title
normal
pass
✓ works
fail
✓ works
negated
pass
✓ works
fail
✓ works
text
normal
pass
✓ works
fail
✓ works
✓ shows selector if available
✓ doesn't show selector if not string
negated
pass
✓ works
fail
✓ works
value
normal
pass
✓ works
fail
✓ works
✓ shows selector if available
✓ doesn't show selector if not string
negated
pass
✓ works
fail
✓ works
enabled
normal
pass
✓ works
fail
✓ works
✓ shows selector if available
✓ doesn't show selector if not string
negated
pass
✓ works
fail
✓ works
displayed
normal
pass
✓ works
fail
✓ works
✓ shows selector if available
✓ doesn't show selector if not string
negated
pass
✓ works
fail
✓ works
exist
built-in
✓ preserves built-ins when not a page object
override
normal
pass
✓ works
fail
✓ works
✓ shows selector if available
✓ doesn't show selector if not string
negated
pass
✓ works
fail
✓ works
elements
normal
pass
✓ works
fail
✓ works
✓ shows selector if available
✓ doesn't show selector if not string
negated
pass
✓ works
fail
✓ works
45 passing (53ms)
packages/cli
$ mocha "test/!(fixtures)/**/*-test.js"
Packages | Cli | Test | Acceptance | Index
✓ works with config (506ms)
✓ prints version (143ms)
✓ allows custom bin (433ms)
✓ before error - no tests run (425ms)
glob
✓ works (419ms)
✓ all tests filtered out (418ms)
duplicate
✓ works (528ms)
✓ all tests filtered out (508ms)
Packages | Cli | Test | Acceptance | Kill-Orphans
✓ works (716ms)
9 passing (4s)
packages/lifecycle
$ mocha --recursive --exit
Packages | Lifecycle | Test | Acceptance | Multiple-Browsers
✓ can manage multiple browsers (98ms)
Packages | Lifecycle | Test | Unit | Index | setUpWebDriver
✓ resets internal state on kill orphans
don't share web driver
✓ log in
✓ don't log in
✓ log in and don't log in
share web driver
✓ log in
✓ don't log in
✓ log in and don't log in
keep browser open
✓ log in
✓ don't log in
✓ log in and don't log in
share session
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 start-web-driver listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 stop-web-driver listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 start-browser listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 start-browsers listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 stop-browser listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 stop-browsers listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 init-context listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 init-session listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 before-begin listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 before-end listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 before-each-begin listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 before-each-end listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 after-each-begin listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 after-each-end listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 after-begin listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 after-end listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
(node:33411) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 reset-internal-state listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
✓ log in
✓ don't log in
✓ log in and don't log in
✓ logs out if role switches
✓ logs out if switching between role and no role
✓ doesn't share session if login failure
throttle network
✓ does nothing
✓ turns on and off
browserOverride
✓ doesn't reuse browser if override changes
overrides
✓ doesn't reuse web driver or browser if overrides change
areRolesEqual
✓ same email
✓ different email
✓ same username
✓ different username
✓ throws when no property match
multiple browsers
✓ log in
✓ don't log in
28 passing (2s)
packages/lint
$ mocha --recursive
chai-webdriver-eventually
valid
✓ expect().to.be
✓ expect()().be
✓ foo().to.be
✓ foo().to.eventually.be
✓ foo().url.to.be
✓ expect().url.to.eventually.be
invalid
✓ expect().url.to.be
mocha-roles-only
valid
✓ foo.only('', function() {})
✓ roles.foo('', function() {})
✓ roles.only
✓ roles('', function() {})
invalid
✓ roles.only('', function() {})
no-browser-throttle
valid
✓ foo.throttleOn()
✓ foo.throttleOff()
✓ browser.throttleOn
✓ browser.throttleOff
✓ _browser.throttleOn
✓ _browser.throttleOff
✓ this.browser.throttleOn
✓ this.browser.throttleOff
✓ this._browser.throttleOn
✓ this._browser.throttleOff
invalid
✓ browser.throttleOn()
✓ browser.throttleOff()
✓ _browser.throttleOn()
✓ _browser.throttleOff()
✓ this.browser.throttleOn()
✓ this.browser.throttleOff()
✓ this._browser.throttleOn()
✓ this._browser.throttleOff()
use-chai-methods
valid
✓ foo()
✓ expect()
✓ expect(foo)
✓ expect(foo())
✓ expect(foo.bar())
✓ expect(foo).text
✓ expect(foo.getUrl)
✓ expect(foo.bar.getUrl)
✓ expect(foo().getUrl)
invalid
✓ expect(foo.getText())
✓ expect(browser.getUrl())
✓ expect(_browser.getUrl())
✓ expect(this.browser.getUrl())
✓ expect(this._browser.getUrl())
44 passing (78ms)
packages/mocha
$ mocha "test/!(fixtures)/**/*-test.js" --exit
Packages | Mocha | Test | Acceptance | Index
runTests
tags
tag
✓ test with no tag
✓ test with a tag #tag1
✓ test with a tag #tag-2
✓ test with a tag #tagC
✓ test with a tag that is a substring of other tags #tag
5 passing (3ms)
✓ works
tag
✓ test with a tag #tag1
1 passing (0ms)
✓ works with a tag
tag
✓ test with a tag #tag1
1 passing (1ms)
✓ ignores #
tag
✓ test with no tag
✓ test with a tag #tag-2
✓ test with a tag #tagC
✓ test with a tag that is a substring of other tags #tag
4 passing (1ms)
✓ works with an inverted tag
tag
✓ test with a tag that is a substring of other tags #tag
1 passing (0ms)
✓ does't match other tags when substring
tag
✓ test with no tag
✓ test with a tag #tag1
✓ test with a tag #tag-2
✓ test with a tag #tagC
4 passing (1ms)
✓ does't match other tags when substring - negated
filter
filter
✓ test with a tag #tag1
1 passing (1ms)
✓ works with a filter
roles
role
#role1
✓ works
#role2
✓ works
#role3
✓ works
##role4
✓ works
##role5
✓ works
##role6
✓ works
6 passing (2ms)
✓ works
role
#role1
✓ works
1 passing (0ms)
✓ works with a role
role
#role2
✓ works
#role3
✓ works
##role4
✓ works
##role5
✓ works
##role6
✓ works
5 passing (2ms)
✓ works with an inverted role
feature flags
flag
✓ test with a flag | flags: flag1
- test with an inverted flag | flags: !flag1
- test with a missing flag | flags: flag2
1 passing (1ms)
2 pending
✓ works
retries
retries
✓ works
1 passing (1ms)
✓ works
reporter
✓ works
failure artifacts
failure artifacts
1) failure
0 passing (2s)
1 failing
1) failure artifacts
failure:
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
assert.ok(false)
+ expected - actual
-false
+true
at Context.<anonymous> (test/fixtures/failure-artifacts-test.js:13:12)
at Context.<anonymous> (src/failure-artifacts.js:33:33)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
✓ works (1869ms)
failure artifacts
✓ success
1 passing (1s)
✓ doesn't make artifacts on test success (1448ms)
Packages | Mocha | Test | Unit | Tag
buildGrep
✓ matches everything
✓ matches a tag
✓ matches multiple tags
✓ negates a tag
✓ negates multiple tags
✓ match and negate a tag
✓ ignores # in input tags
✓ matches a filter
✓ matches a filter and a tag
✓ a filter can also match a tag
25 passing (4s)
packages/page-objects
$ mocha --recursive --exit
Packages | Page-Objects | Test | Acceptance | Api-Verification
✓ isEnabled (129ms)
✓ waitForEnabled (65ms)
✓ waitForDisabled (50ms)
✓ isDisplayed
✓ waitForVisible
✓ waitForHidden
✓ isExisting (42ms)
✓ waitForInsert
✓ waitForDestroy
✓ getAttribute
Packages | Page-Objects | Test | Acceptance | _chain
✓ can chain (111ms)
Packages | Page-Objects | Test | Acceptance | Elements
ChildType
✓ can override (147ms)
iterating
✓ works with implicit style (77ms)
✓ works with extending style (56ms)
API
✓ getLength
✓ get first
✓ get last
✓ nth
Packages | Page-Objects | Test | Acceptance | Extend
✓ can override a default class via empty string
Packages | Page-Objects | Test | Acceptance | Index
wrapping page objects
✓ can send a page object to create
✓ using existing function doesn't cause a loop
✓ properly chains _super calls
Element
✓ works
✓ using existing function doesn't cause a loop
✓ can pass a page object to create
✓ can chain page objects
Elements
✓ works
✓ single child
✓ multiple children (43ms)
✓ each props are available to chaining
✓ scoping is lazy (158ms)
error handling
✓ doesn't retry when actually missing
isExisting
✓ ignores child's missing parent when checking for exist
✓ ignores children's missing parent when checking for exist
waitForInsert
✓ recursively waits for insert of child's parents
✓ recursively waits for insert of childrens' parents
waitForDestroy
✓ ignores child's missing parent when waiting for destroy
✓ ignores children's missing parent when waiting for destroy
stale
✓ handles a stale Element (98ms)
✓ handles a stale Elements (80ms)
scoping
✓ scopeBy handles a missing parent (42ms)
✓ scopeBy handles a missing child (51ms)
✓ scopeChildren: prevent waiting for existence on an already resolved empty array (75ms)
✓ scopeByText: findByText is properly retried (56ms)
Packages | Page-Objects | Test | Acceptance | purgeOld
✓ can purge old rows (199ms)
✓ purges only two rows by default (107ms)
✓ purges from the end of the list (134ms)
✓ purges the last two out of range rows, ignoring in range (133ms)
✓ throws a descriptive error if missing row.name
✓ throws a descriptive error if missing row.deleteRow
Packages | Page-Objects | Test | Acceptance | Set-Password
✓ can set a password (178ms)
Packages | Page-Objects | Test | Unit | Date
✓ encodes a string
✓ should not purge if name mismatch
✓ should not purge if match and in range
✓ should purge if match and not in range
✓ should purge if match and force not in range
56 passing (11s)
packages/remote
$ mocha --recursive --exit
Packages | Remote | Test | Acceptance | Multiple-Browsers
✓ can manage multiple browsers (3678ms)
Packages | Remote | Test | Integration | Index
crashed web driver cleans up browsers
✓ chrome (1456ms)
✓ firefox (6214ms)
can alter capabilities
✓ chrome (1667ms)
✓ firefox (2280ms)
killOrphans
✓ cleans up web drivers (654ms)
cleans up browsers too
✓ chrome (1560ms)
✓ firefox (2751ms)
getNewPort
✓ returns requested port when in use
✓ returns random port when zero
✓ returns random port when falsy
Packages | Remote | Test | Unit | Index
killOrphans
✓ handles processes that died before the kill
- throws if kill fails for another reason
startWebDriver
✓ cleans up browsers
✓ doesn't clean up browsers if disabled
stopWebDriver
✓ ignores null
stopBrowser
✓ ignores null
16 passing (22s)
1 pending
packages/utils
$ mocha --recursive --exit
Packages | Utils | Test | Integration | Event
✓ works
Packages | Utils | Test | Integration | waitForDownload
✓ can time out
✓ finds already existing file
✓ watches for file creation
Packages | Utils | Test | Unit | Event
emit
✓ works
on
✓ works
6 passing (22ms)
✨ Done in 63.66s.
~/Projects/faltest feat/281-rules-format 1m 4s
❯ echo $?
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment