forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#79979 - GuillaumeGomez:rustdoc-gui-tests, r=M…
…ark-Simulacrum Rustdoc gui tests This is a reopening of rust-lang#70533. For this first version, there will be no screenshot comparison. Also, a big change compared to the previous version: the tests are now hosted in the rust repository directly. Since there is no image, it's pretty lightweight to say the least. So now, only remains the nodejs script to run the tests and the tests themselves. Just one thing is missing: where should I put the documentation for these tests? I'm not sure where would be the best place for that. The doc will contain important information like the documentation of the framework used and how to install it (`npm install browser-ui-test`, but still needs to be put somewhere so no one is lost). We'd also need to install the package when running the CI too. For now, it runs as long as we have nodejs installed, but I think we don't it to run in all nodejs targets? cc `@jyn514` r? `@Mark-Simulacrum`
- Loading branch information
Showing
19 changed files
with
312 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
goto: file://|DOC_PATH|/index.html | ||
click: ".srclink" | ||
assert: (".line-numbers", 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
goto: file://|DOC_PATH|/index.html | ||
assert: ("#functions") | ||
goto: ./struct.Foo.html | ||
assert: ("div.type-decl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
goto: file://|DOC_PATH|/index.html | ||
click: ".srclink" | ||
click: "#sidebar-toggle" | ||
wait-for: 500 | ||
fail: true | ||
assert: ("#source-sidebar", { "left": "-300px" }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
//! The point of this crate is to be able to have enough different "kinds" of | ||
//! documentation generated so we can test each different features. | ||
|
||
#![crate_name = "test_docs"] | ||
|
||
use std::fmt; | ||
|
||
/// Basic function with some code examples: | ||
/// | ||
/// ``` | ||
/// println!("nothing fancy"); | ||
/// ``` | ||
/// | ||
/// A failing to compile one: | ||
/// | ||
/// ```compile_fail | ||
/// println!("where did my argument {} go? :'("); | ||
/// ``` | ||
/// | ||
/// An ignored one: | ||
/// | ||
/// ```ignore (it's a test) | ||
/// Let's say I'm just some text will ya? | ||
/// ``` | ||
pub fn foo() {} | ||
|
||
/// Just a normal struct. | ||
pub struct Foo; | ||
|
||
/// Just a normal enum. | ||
pub enum WhoLetTheDogOut { | ||
/// Woof! | ||
Woof, | ||
/// Meoooooooow... | ||
Meow, | ||
} | ||
|
||
/// Who doesn't love to wrap a `format!` call? | ||
pub fn some_more_function<T: fmt::Debug>(t: &T) -> String { | ||
format!("{:?}", t) | ||
} | ||
|
||
/// Woohoo! A trait! | ||
pub trait AnotherOne { | ||
/// Some func 1. | ||
fn func1(); | ||
|
||
/// Some func 2. | ||
fn func2(); | ||
|
||
/// Some func 3. | ||
fn func3(); | ||
} | ||
|
||
/// Check for "i" signs in lists! | ||
/// | ||
/// 1. elem 1 | ||
/// 2.test 1 | ||
/// ```compile_fail | ||
/// fn foo() {} | ||
/// ``` | ||
/// 3. elem 3 | ||
/// 4. ```ignore (it's a test) | ||
/// fn foo() {} | ||
/// ``` | ||
/// 5. elem 5 | ||
pub fn check_list_code_block() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
goto: file://|DOC_PATH|/index.html | ||
goto: ./fn.check_list_code_block.html | ||
assert: ("pre.rust.fn") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
goto: file://|DOC_PATH|/index.html | ||
click: "#theme-picker" | ||
click: "#theme-choices > button:first-child" | ||
wait-for: 500 | ||
// should be the ayu theme so let's check the color | ||
assert: ("body", { "background-color": "rgb(15, 20, 25)" }) | ||
click: "#theme-choices > button:last-child" | ||
wait-for: 500 | ||
// should be the light theme so let's check the color | ||
assert: ("body", { "background-color": "rgb(255, 255, 255)" }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
goto: file://|DOC_PATH|/index.html | ||
click: "#toggle-all-docs" | ||
wait-for: 5000 | ||
assert: ("#main > div.docblock.hidden-by-usual-hider") | ||
click: "#toggle-all-docs" | ||
wait-for: 5000 | ||
assert: ("#main > div.docblock.hidden-by-usual-hider", 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.