1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-19 22:19:29 +02:00
michael-kerscher 2cf9a35b23
Check if menu bar buttons are display and functionality works (#2621)
Test the main page for existence of
- theme button visible
  - clicking shows the list of themes
- search button visible
  - and tests successful search for "Welcome"
- language button visible
  - clicking shows the list of languages

this is testing functionality missing in dev environments in
https://github.com/google/comprehensive-rust/issues/2588 and is relevant
for https://github.com/google/comprehensive-rust/issues/2620
2025-02-04 10:36:34 +01:00
..

Testing Comprehensive Rust

The course material contains JS code that can break and needs to be checked for functionality. Examples are theme/speaker-notes.js or theme/book.js.

Comprehensive Rust is using webdriverIO and the webdriverIO Expect API in combination with [Mocha] (https://mochajs.org/). WebdriverIO is taking care of accessing the webpage with a real browser and can access the state of the page so behavior can be asserted.

The Static Server Service is used mainly in the CI to serve the book on port localhost:8080 such that the test runner can access it. This mode is used when npm start or npm test is executed.

For local testing and quick iterations it is possible to use mdbook serve which creates a small HTTP server on port 3000 by default. There is a special config that is invoked with npm run test-mdbook that uses http://localhost:3000