-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Webdriver student project
Background information: WebDriver is a tool that's used for automatically testing web applications. It has also been adapted for automating web browsers while running tests. This project aims to create a server that will receive connections from WebDriver clients and execute commands to improve our test automation abilities.
Initial step: Build Servo, then email the mozilla.dev.servo mailing list introducing your group. Make a new crate (aka library) that will be responsible for running a server and interacting with the protocol (see components/devtools_traits for an example of a minimal crate). Add a run_server function that takes a port number, and call it using the result of parsing a --webdriver command line argument from the code in components/servo/lib.rs. Use the code that starts a devtools server for reference (see components/devtools/lib.rs and components/servo/lib.rs).
Subsequent steps:
- Import the webdriver-rust library by modifying the appropriate
Cargo.tomland start a server from therun_serverfunction added previously. Use a stub implementation of theWebDriverHandlerthat only includes as much code as is necessary to make it compile. - Process the
NewSession/DeleteSessioncommand by creating the necessary state and storing it in a hashtable in the newwebdrivercrate. - Process the Get command by sending a message to the script task to initiate a load of the given URL.
- Process the
ExecuteAsyncScriptcommand by instructing the script task to execute the given JavaScript, usinghandle_evaluate_jsincomponents/script/devtools.rsas a model. - Process the
ExecuteScriptcommand usingExecuteAsyncScriptas a basis. - Process the
TakeScreenshotcommand by instructing the compositor to output a screenshot (seecompositeincomponents/compositing/compositor.rs.