Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Demo App] Add more UI tests on demo app #154

Closed
11 of 15 tasks
pylapp opened this issue Oct 4, 2024 · 0 comments · Fixed by #197
Closed
11 of 15 tasks

[Demo App] Add more UI tests on demo app #154

pylapp opened this issue Oct 4, 2024 · 0 comments · Fixed by #197
Assignees
Labels
📱 demo app Update of the Demo App

Comments

@pylapp
Copy link
Member

pylapp commented Oct 4, 2024

Description

The demo applicaiton now exposes tokens and renders them.
However lot of UI tests are missing and should be added for eack token section.

The swift-snpashot-testing must be used.

Definition of Done

  • Add UI tests for border (for Orange theme)
  • Add UI tests for border (for Sosh theme)
  • Add UI tests for border (for Inverse theme)
  • Add UI tests for elevation (for Orange theme)
  • Add UI tests for elevation (for Sosh theme)
  • Add UI tests for elevation (for Inverse theme)
  • Add UI tests for opacity (for Orange theme)
  • Add UI tests for opacity (for Sosh theme)
  • Add UI tests for opacity (for Inverse theme)
  • Add UI tests for typography (for Orange theme)
  • Add UI tests for typography (for Sosh theme)
  • Add UI tests for typography (for Inverse theme)
  • Add UI tests for components screen (to ensure it remains empty)
  • Update of course CHANGELOG, documentation if needed, etc.
  • Keep updated the ShowcaseUITestPlan

Other details

Previous tests defined for fake components can be used (not as is and improved of course).
For each tokens groupe, define an XCTestCase file and add as many test functions as tokens and theme combinations. For example, create a OUDSTokensElevationUITests file with 9 x 3 test functions (3 thèmes, 9 tokens).

import OUDSComponents
import OUDSThemesOrange
import OUDSThemesSosh
import OUDSThemesInverse
import SwiftUI
import XCTest

/// Class to make UI tests on the fake component `OUDSFormsTextInput` using the
/// [swift-snapshot-testing](https://github.com/pointfreeco/swift-snapshot-testing) library.
final class OUDSFormsTextInputUITests: XCTestCase {

    // MARK: - Wrapper

    private struct TestFormsTextInput: View {
        @State private var value: String = ""

        var body: some View {
            OUDSFormsTextInput(label: "Some label", hint: "Some hint", placeholder: "Add text here", value: $value)
        }
    }

    // MARK: - Tests

    func testOUDSFormsTextInput_OrangeTheme() {
        Snapshot.assert(TestFormsTextInput().environment(\.theme, OrangeTheme()), testName: "\(#function)OrangeTheme")
    }

    func testOUDSFormsTextInput_SoshTheme() {
        Snapshot.assert(TestFormsTextInput().environment(\.theme, SoshTheme()), testName: "\(#function)SoshTheme")
    }

    func testOUDSFormsTextInput_InverseTheme() {
        Snapshot.assert(TestFormsTextInput().environment(\.theme, InverseTheme()), testName: "\(#function)InverseTheme")
    }
}
@pylapp pylapp added the 📱 demo app Update of the Demo App label Oct 4, 2024
@pylapp pylapp moved this from Triage to Todo in [OUDS] Project Oct 4, 2024
@Tayebsed93 Tayebsed93 linked a pull request Oct 16, 2024 that will close this issue
9 tasks
pylapp added a commit that referenced this issue Nov 20, 2024
…#197)

Reviewed-by-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com>
Signed-off-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com>
Co-authored-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com>
Co-authored-by: Tayeb Sedraia <tayeb.sedraia@orange.com>
@github-project-automation github-project-automation bot moved this from In Progress to Done in [OUDS] Project Nov 20, 2024
@pylapp pylapp mentioned this issue Nov 29, 2024
pylapp added a commit that referenced this issue Nov 29, 2024
Release of version 0.7.0
See below the full CHANGELOG details.

Added:
- [DemoApp] Add code sample for tokens usages in token pages ([#283](#283))
- [Library] Color some new semantic tokens `colorContentStatus*`,  `colorContentOnBrand*`, `colorContentOnStatus*`, `colorGradient*`, `colorBorder*`, `colorContentOnAction*`
- [Tool] Add UI tests in CI/CD pipelines ([#298](#298))
- [DemoApp] Add more UI tests on demo app ([#154](#154))

Changed:
- [Library] Update `GridSemanticTokens` tokens (tokenator *20241129080807*)
- [Library] Types `GridExtraCompactSemanticToken`, `GridCompactSemanticToken` and `GridRegularSemanticToken` replaced by `GridSemanticToken` to make tokenator updates integration easier 
- [DemoApp] Update space tokens screen ([#275](#275))
- [Library] Update `GridRawTokens` tokens (tokenator *20241128161629*)
- [DemoApp] Update color tokens screen 
- [Library] Update `ColorSemanticTokens` tokens (tokenator *20241127112301*)
- [Library] Update `SpaceSemanticTokens` tokens (tokenator *20241127074206*)
- [Library] Update `SizeSemanticTokens` with rename of tokens (tokenator *20241126134156*)
- [Library] Update `ElevationSemanticTokens` (tokenator *20241126120657*)
- [Library] Improve Multiple-based objects for tokenator values integration ([#279](#279))
- [Tool] Use `macos-15` runner for GitHub Actions builds ([#296](#296))

Removed:
- [Library] Grid semantic tokens `gridExtraCompactColumnCount`, `gridCompactColumnCount` and `gridRegularColumnCount`
- [Library] Grid raw tokens `gridMargin900`
- [Library] Color semantic tokens `colorContentOnBg*`, `colorBorderOnBg*`, `colorBorderStatus*`, some `colorAction*OnBg*`, `colorDecorative{Primary,Secondary,Tertiary}`, `colorAlwaysOnBg*`, `colorBgBrand{Secondary,Tertiary}`, `colorContentBrand{Secondary,Tertiary}`, `colorBorderBrand{Secondary,Tertiary}`, `colorContentStatusAccent`, ...
- [Library] Some space semantic tokens type aliases to help tokenator job (`SpacePaddingInlineSemanticToken`, `SpacePaddingBlockSemanticToken`, `SpaceGapInlineSemanticToken`, `SpaceGapStackSemanticToken`)
- [Library] All dimension semantic tokens ([#308](#308))

Fixed:
- [DemoApp] Fix VoiceOver issue with element grouping in presentation tokens and update accessibility statement ([#212](#285))
- [Library] Warning issues for DocC catalogs ([#293](#293))

Co-authored-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com>
Co-authored-by: Ludovic Pinel <ludovic.pinel@orange.com>
Co-authored-by: Tayeb Sedraia <tayeb.sedraia@orange.com>
Co-authored-by: boosted-bot <boosted-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📱 demo app Update of the Demo App
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants