pub struct Ice {
pub viewport: Size,
pub mode: Mode,
pub preset: Option<String>,
pub instructions: Vec<Instruction>,
}Expand description
An end-to-end test for iced applications.
Ice tests encode a certain configuration together with a sequence of instructions. An ice test passes if all the instructions can be executed successfully.
Normally, ice tests are run by an Emulator in continuous
integration pipelines.
Ice tests can be easily run by saving them as .ice files in a folder and simply
calling run. These test files can be recorded by enabling the tester
feature flag in the root crate.
Fields§
§viewport: SizeThe viewport Size that must be used for the test.
mode: ModeThe emulator::Mode that must be used for the test.
preset: Option<String>The name of the Preset that must be used for the test.
instructions: Vec<Instruction>The sequence of instructions of the test.
Implementations§
Source§impl Ice
impl Ice
Sourcepub fn parse(content: &str) -> Result<Self, ParseError>
pub fn parse(content: &str) -> Result<Self, ParseError>
Parses an Ice test from its textual representation.
Here is an example of the Ice test syntax:
viewport: 500x800
mode: Immediate
preset: Empty
-----
click "What needs to be done?"
type "Create the universe"
type enter
type "Make an apple pie"
type enter
expect "2 tasks left"
click "Create the universe"
expect "1 task left"
click "Make an apple pie"
expect "0 tasks left"This syntax is very experimental and extremely likely to change often. For this reason, it is reserved for advanced users that want to early test it.
Currently, in order to use it, you will need to earn the right and prove you understand its experimental nature by reading the code!