Skip to content

Commit

Permalink
review : create documentation ui test snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
Tayebsed93 committed Oct 18, 2024
1 parent ab10384 commit eb286c0
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,33 @@ Indeed for new tests the tool makes snapshots of the views, thus for the first r

Such tests here are used to as to be sure the look and feel of any components and tokens rendering remaing the expected ones.

### Steps to Use swift-snapshot-testing

1. Navigate to the Project :
- Open your project in Xcode and go to the directory:
```shell
Showcase -> ShowcaseTests -> OUDSTokensBorderUITests
```
2. Locate Reference Images:
- Inside the `OUDSTokensBorderUITests` folder, you will find the `OrangeTheme` and `InverseTheme` directories. These folders contain the reference screenshots for the Orange and Inverse themes, which will serve as comparison points.
3. Open the Test File:
- Open the file `OUDSTokensBorderUITests.swift`.
4. Run the Snapshot Test:
- Locate and execute the function `testBorderToken_OrangeTheme_SectionWidth_BorderWidthNone_Light()`.
- Running this test will launch the selected simulator and create a new snapshot of the `BorderTokenPage`.
5. Run the Snapshot Test:
- After the snapshot has been generated, re-run the same test to use the newly created snapshot as a comparison against the reference image.
6. Verify the Output:
- The test will check the rendered output of the `BorderTokenPage`, which is instantiated with the `Orange theme`:
```swift
BorderTokenPage().environment(\.theme, OrangeTheme())
```
- If the generated screenshot matches the reference image, the test will pass. If they do not match, the test will fail, indicating a discrepancy
7. Verify the Output:
- **Important:** If you change the device or simulator you are using, **delete the snapshots** located in the `__Snapshots__` folder to avoid mismatches:
- Snapshots should **never be committed** to the repository, as they are meant for local testing purposes only
## Build phases
The project contains several custom build phases so as to automatize several steps:
Expand Down Expand Up @@ -277,4 +304,4 @@ Our currant plan does not allow to make GitHub mirroring, so we use GitHub HTTP
If you want to set up your runners, feel free to have a look on */docs_release/README.md*
However of course you will have to define all the variables, secrets and have the mandatory files listed above.
You can find more details about the pipelines and script [in the wiki](https://github.com/Orange-OpenSource/ouds-ios/wiki/5-%E2%80%90-About-continuous-integration-and-delivery).
You can find more details about the pipelines and script [in the wiki](https://github.com/Orange-OpenSource/ouds-ios/wiki/5-%E2%80%90-About-continuous-integration-and-delivery).

0 comments on commit eb286c0

Please sign in to comment.