refactor: move rule editor actions into the navigation bar
- Both editor modes commit via a checkmark confirmation button (role: .confirm) in the navigation bar — accessibility labels 'Add Rule' (create) and 'Done' (edit); replaces the bottom 'Add Rule' button, so nothing floats over the form anymore - Edit mode gains an ellipsis 'Rule Actions' menu next to the checkmark holding Disable/Enable Rule and destructive Delete Rule; the red form rows are removed - Tests pin the checkmark to the navigation bar with its label and drive disable/delete through the menu; the swipe-to-reach workarounds are gone. 95 passing - Spec §6 updated
This commit is contained in:
@@ -22,8 +22,11 @@ final class RuleCreationUITests: XCTestCase {
|
||||
XCTAssertEqual(app.staticTexts["ruleEditorTitle"].waitToAppear().label, "In the Zone")
|
||||
XCTAssertTrue(app.staticTexts["During this time"].exists)
|
||||
|
||||
// Hold to commit saves the rule and returns home.
|
||||
app.buttons["commitRuleButton"].waitToAppear().tap()
|
||||
// The confirmation checkmark lives in the navigation bar and carries
|
||||
// a descriptive accessibility label.
|
||||
let commit = app.navigationBars.buttons["commitRuleButton"].waitToAppear()
|
||||
XCTAssertEqual(commit.label, "Add Rule")
|
||||
commit.tap()
|
||||
app.buttons["ruleCard-In the Zone"].waitToAppear()
|
||||
XCTAssertFalse(app.element("emptyRulesCard").exists)
|
||||
}
|
||||
|
||||
@@ -47,10 +47,12 @@ final class RuleManagementUITests: XCTestCase {
|
||||
|
||||
app.buttons["ruleCard-Sleep"].waitToAppear().tap()
|
||||
app.buttons["editRuleButton"].waitToAppear().tap()
|
||||
// The disable/delete rows sit at the bottom of the form.
|
||||
app.staticTexts["ruleEditorTitle"].waitToAppear()
|
||||
app.swipeUp()
|
||||
app.buttons["toggleEnabledButton"].waitToAppear().tap()
|
||||
|
||||
// Disable lives in the ellipsis menu in the navigation bar.
|
||||
let actionsMenu = app.navigationBars.buttons["ruleActionsMenu"].waitToAppear()
|
||||
XCTAssertEqual(actionsMenu.label, "Rule Actions")
|
||||
actionsMenu.tap()
|
||||
app.buttons["Disable Rule"].waitToAppear().tap()
|
||||
|
||||
// The detail caption now reports the rule as disabled.
|
||||
let status = app.staticTexts["detailStatusLabel"].waitToAppear()
|
||||
@@ -66,10 +68,10 @@ final class RuleManagementUITests: XCTestCase {
|
||||
|
||||
app.buttons["ruleCard-Sleep"].waitToAppear().tap()
|
||||
app.buttons["editRuleButton"].waitToAppear().tap()
|
||||
// The disable/delete rows sit at the bottom of the form.
|
||||
app.staticTexts["ruleEditorTitle"].waitToAppear()
|
||||
app.swipeUp()
|
||||
app.buttons["deleteRuleButton"].waitToAppear().tap()
|
||||
|
||||
// Delete lives in the ellipsis menu in the navigation bar.
|
||||
app.navigationBars.buttons["ruleActionsMenu"].waitToAppear().tap()
|
||||
app.buttons["Delete Rule"].waitToAppear().tap()
|
||||
|
||||
app.buttons["newRuleButton"].waitToAppear()
|
||||
XCTAssertFalse(
|
||||
|
||||
Reference in New Issue
Block a user