Commit Graph

26 Commits

Author SHA1 Message Date
Daniel Martí
da4ac414ed get rid of all sleeps in tests
The navigate sleeps can be replaced by appropriate wait actions.

Some other tests don't need any sleeps at all. This might be because
work is done synchronously now; I haven't been able to get test flakes
after hundreds of test runs with flags like -parallel=32 -count=200.
2019-04-01 12:18:16 +01:00
Daniel Martí
61f0a8da68 make some linters a bit happier 2019-04-01 12:18:16 +01:00
Daniel Martí
92bfcc3c8d collapse a few Navigate actions in the tests 2019-04-01 12:18:16 +01:00
Daniel Martí
81a48280ef route all communication via the browser
Use a single websocket connection per browser, removing the need for an
extra websocket connection per target.

This is thanks to the Target.sendMessageToTarget command to send
messages to each target, and the Target.receivedMessageFromTarget event
to receive messages back.

The browser handles activity via a single worker goroutine, and the same
technique is used for each target. This means that commands and events
are dealt with in order, and we can do away with some complexity like
mutexes and extra go statements.
2019-04-01 12:18:16 +01:00
Daniel Martí
3d3bf22ccc start the chromedp v2 refactor
First, we want all of the functionality in a single package; this means
collapsing whatever is useful into the root chromedp package.

The runner package is being replaced by the Allocator interface, with a
default implementation which starts browser processes.

The client package doesn't really have a place in the new design. The
context, allocator, and browser types will handle the connection with
each browser.

Finally, the new API is context-based, hence the addition of context.go.
The tests have been modified to build and run against the new API.
2019-04-01 12:17:28 +01:00
Daniel Martí
811d6d54d3 don't run TestFileUpload subtests in parallel
Turns out that these subtests are the only pair which cannot run in
parallel with each other. Undo that change and add a TODO. This should
fix the CI failures.

While at it, remove an unnecessary testAllocate line.
2019-02-21 17:22:40 +01:00
Daniel Martí
da4f783362 make all tests run in parallel
The subtests were almost all marked as parallel, but that's not enough.
That only makes the subtests run in parallel with other subtests within
the same tests, not with any other test.

Since none of the tests make use of globals nor require the entire
program to themselves, properly run all the tests in parallel.

Speeds up 'go test' on my 8-core laptop from an average of ~130s to an
average of ~50s. Many tests hit timeouts and have sleeps, so we want to
avoid running those sequentially whenever possible.
2019-02-21 13:56:54 +01:00
Kenneth Shaw
1e1a3ace12 General code cleanup 2018-05-19 05:06:19 +07:00
Kenneth Shaw
f683cfc4c1 Minor code cleanup 2018-03-27 04:31:09 +07:00
Kenneth Shaw
b0c2445e67 Splitting repositories 2017-12-28 11:17:14 +07:00
Kenneth Shaw
380c95b6c0 Minor documentation cleanup from last commit 2017-12-18 10:48:40 +07:00
kotamat
07208b1cc3 Add Atributes All feature 2017-12-18 10:42:13 +07:00
kotamat
8f3b889b9f add test code for query
it will be through the coverage test
2017-12-18 10:39:44 +07:00
Kenneth Shaw
1a35cceeae Adding OuterHTML and InnerHTML actions 2017-07-01 11:53:22 +07:00
Kenneth Shaw
df490a3025 Adding SetUploadFiles and changing SendKeys behavior
Added high level action SetUploadFiles to set the upload files for a
input[type="file"] node, and modified SendKeys to recognize the nodes.

Additionally, added unit test for both, and updated the
examples/upload/main.go to use the SendKeys variant.
2017-07-01 10:14:42 +07:00
Kenneth Shaw
fa3cf26d37 Minor changes to unit tests in attempt to fix issues with travis 2017-06-18 09:32:12 +07:00
Kenneth Shaw
22e287750a Fixing misspelling issues 2017-03-02 09:53:47 +07:00
Randy Cahyana
f85f3777fa Fixing issue when node is offscreen and more.
- Adding ScrollIntoNode action.
- Adding isOnViewJS snippet.
- Fixing race issue in some unit tests.
2017-02-27 19:17:36 +07:00
Randy Cahyana
3a264ed3ff Adding unit test for navigation actions and few minor changes. 2017-02-23 16:39:29 +07:00
Randy Cahyana
a4cd7f9783 Removing external url on navigation and query actions. 2017-02-22 19:55:45 +07:00
Kenneth Shaw
092361d170 Changing selector in TestClick 2017-02-22 16:10:42 +07:00
Randy Cahyana
1988de618d Adding unit test for navigation actions. 2017-02-21 09:08:18 +07:00
Kenneth Shaw
2b0edf7c25 Fixing unit test output from last commit 2017-02-18 13:31:59 +07:00
Kenneth Shaw
dc17e7f8cd Parallelizing unit tests 2017-02-18 13:12:21 +07:00
Kenneth Shaw
b5687e625d Adding missing patches from ranch 2017-02-18 12:37:28 +07:00
Randy Cahyana
0db7a9ee72 Increasing unit test coverage on query.go 2017-02-18 10:50:33 +07:00