Skip to content

Commit

Permalink
Adding more ui navigation tests from the tools list
Browse files Browse the repository at this point in the history
  • Loading branch information
levieggertcru committed Jul 22, 2024
1 parent 4b469cb commit 2de36a2
Showing 1 changed file with 45 additions and 3 deletions.
48 changes: 45 additions & 3 deletions godtoolsUITests/App/Flows/App/AppFlowTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extension AppFlowTests {

private func getDashboardTabButton(buttonAccessibility: AccessibilityStrings.Button) -> XCUIElement {

return app.queryButton(buttonAccessibility: buttonAccessibility).firstMatch
return app.queryFirstButtonMatching(buttonAccessibility: buttonAccessibility)
}

private func tabToLessons() {
Expand Down Expand Up @@ -115,7 +115,9 @@ extension AppFlowTests {

tabToFavorites()

let toolDetails = app.queryButton(buttonAccessibility: .toolDetails).firstMatch
let toolDetailsButtons = app.buttons[AccessibilityStrings.Button.toolDetails.id]

let toolDetails = app.queryFirstButtonMatching(buttonAccessibility: .toolDetails)

XCTAssertTrue(toolDetails.exists)

Expand All @@ -130,7 +132,7 @@ extension AppFlowTests {

tabToFavorites()

let toolDetails = app.queryButton(buttonAccessibility: .toolDetails).firstMatch
let toolDetails = app.queryFirstButtonMatching(buttonAccessibility: .toolDetails)

XCTAssertTrue(toolDetails.exists)

Expand Down Expand Up @@ -181,4 +183,44 @@ extension AppFlowTests {

assertIfScreenDoesNotExist(app: app, screenAccessibility: .toolsLanguageFilters)
}

func testTappingSpotlightToolFromToolsOpensToolDetails() {

launchApp()

tabToTools()

let spotlightTool = app.queryDescendants(id: AccessibilityStrings.Button.spotlightTool.id)

guard let spotlightTool = spotlightTool else {
XCTAssertNotNil(spotlightTool, "Found nil element.")
return
}

XCTAssertTrue(spotlightTool.exists)

spotlightTool.tap()

assertIfScreenDoesNotExist(app: app, screenAccessibility: .toolDetails)
}

func testTappingToolFromToolsOpensToolDetails() {

launchApp()

tabToTools()

let tool = app.queryDescendants(id: AccessibilityStrings.Button.tool.id)

guard let tool = tool else {
XCTAssertNotNil(tool, "Found nil element.")
return
}

XCTAssertTrue(tool.exists)

tool.tap()

assertIfScreenDoesNotExist(app: app, screenAccessibility: .toolDetails)
}
}

0 comments on commit 2de36a2

Please sign in to comment.