-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🦄 refactor: Simplify test apis, add doc
- Merge a lot of functions into script_run
- Loading branch information
Showing
12 changed files
with
232 additions
and
310 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,11 +37,11 @@ jobs: | |
- runner: ubuntu-latest | ||
target: ppc64le | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y pkg-config libssl-dev openssl | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
|
@@ -72,11 +72,11 @@ jobs: | |
- runner: ubuntu-latest | ||
target: armv7 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y pkg-config libssl-dev openssl | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
|
@@ -103,10 +103,10 @@ jobs: | |
- runner: windows-latest | ||
target: x86 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: | | ||
choco install -y openssl | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
|
@@ -133,10 +133,10 @@ jobs: | |
- runner: macos-14 | ||
target: aarch64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: | | ||
brew install [email protected] | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
|
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/target | ||
*.log | ||
*.cast | ||
*.deprecated | ||
|
||
# Byte-compiled / optimized / DLL files | ||
|
||
|
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 was deleted.
Oops, something went wrong.
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,28 @@ | ||
//! Api for GUI part testing | ||
//! | ||
//! For GUI part, basicially we need to check the following: | ||
//! - Is the current screen is the expected screen? | ||
//! - Does the screen have the expected elements? | ||
//! - Can we interact with the screen? | ||
use std::error::Error; | ||
|
||
use crate::gui::screen::Screen; | ||
|
||
use super::needle::Needle; | ||
|
||
/// The API can used for testing, with bypass [`Screen`] operations. | ||
pub trait GuiTestApi: Screen { | ||
/// Check if the current screen is the expected screen | ||
fn assert_screen(&mut self, needle: Needle) -> Result<(), Box<dyn Error>>; | ||
/// Check and click the target position | ||
/// | ||
/// Suggest using assert_screen and click seperately, as futher consider adding relative position etc. | ||
fn assert_screen_click(&mut self, needle: Needle) -> Result<(), Box<dyn Error>>; | ||
|
||
/// Wait until current screen changed | ||
fn wait_screen_change(&mut self, timeout: u32) -> Result<(), Box<dyn Error>>; | ||
|
||
/// Wait and assert the screen won't change in timeout | ||
fn wait_still_screen(&mut self, timeout: u32) -> Result<(), Box<dyn Error>>; | ||
} |
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,5 @@ | ||
pub mod cli_api; | ||
pub mod cli_exec; | ||
pub mod gui_api; | ||
|
||
pub mod needle; |
Oops, something went wrong.