Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions VoiceOverDesignerUITests/PageObjects/Panels/StatusBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,35 @@
import XCTest

class StatusBar: ProjectPanel {

var statusBar: XCUIElement { app.menuBars.firstMatch }

var fileMenu: XCUIElement {statusBar.menuBarItems["File"].firstMatch}

var editMenu: XCUIElement { statusBar.menuBarItems["Edit"].firstMatch }

var fileNewMenu: XCUIElement {statusBar.menuItems["New"].firstMatch}

var selectAllMenu: XCUIElement { statusBar.menuItems["Select All"].firstMatch }

var undoMenu: XCUIElement {statusBar.menuItems["Undo"].firstMatch}

var redoMenu: XCUIElement {statusBar.menuItems["Redo"].firstMatch}

@discardableResult
func clickFile() -> Self {
fileMenu.click()

return self
}

@discardableResult
func clickFileNew() -> Self {
fileNewMenu.click()

return self
}

@discardableResult
func clickEdit() -> Self {
editMenu.click()
Expand All @@ -27,6 +50,20 @@ class StatusBar: ProjectPanel {

return self
}

@discardableResult
func clickUndoMenu() -> Self {
undoMenu.click()

return self
}

@discardableResult
func clickRedoMenu() -> Self {
redoMenu.click()

return self
}

@discardableResult
func openInFullScreen() -> Self {
Expand Down
48 changes: 19 additions & 29 deletions VoiceOverDesignerUITests/Tests/CanvasTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,40 +37,34 @@ final class CanvasTests: DesignerTests {
XCTAssertTrue(app.staticTexts["Add your screenshot"].exists)
assertNavigatorElements(count: 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тоже в пейдж навигатор


let menuBarsQuery = app.menuBars
let editMenuBarItem = menuBarsQuery.menuBarItems["Edit"]
editMenuBarItem.click()
menuBarsQuery.menuItems["Undo"].click()
statusBar
.clickEdit()
.clickUndoMenu()
XCTAssertFalse(app.staticTexts["Add your screenshot"].exists)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Подвинуть ассерт в пейдж Settings

assertNavigatorElements(count: 1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Подвинуть ассерт в пейдж Navigator

//editMenuBarItem.click()
//menuBarsQuery.menuItems["Redo"].click()
//XCTAssertTrue(app.staticTexts["Add your screenshot"].exists)
/*statusBar
.clickEdit()
.clickRedoMenu()
XCTAssertTrue(app.staticTexts["Add your screenshot"].exists)*/

}

func testDragUndoRedo() {
let from = CGVector(dx: 0.45, dy: 0.45)
let to = CGVector(dx: 0.5, dy: 0.5)

let window = app.windows.firstMatch
let start = window.coordinate(withNormalizedOffset: from)
let finish = window.coordinate(withNormalizedOffset: to)

start.press(forDuration: 0.01, thenDragTo: finish)
canvas
.drag(from: 0.45, to: 0.5)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

После перетаскивания нужен ассерт

let menuBarsQuery = app.menuBars
let editMenuBarItem = menuBarsQuery.menuBarItems["Edit"]
editMenuBarItem.click()
menuBarsQuery.menuItems["Undo"].click()
editMenuBarItem.click()
menuBarsQuery.menuItems["Redo"].click()
statusBar
.clickEdit()
.clickUndoMenu()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

После анду нужен ассерт

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

.clickEdit()
.clickRedoMenu()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

После реду нужен ассерт

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


}

func testCreateOneElementContainer() {
//Разворачиваем приложение на весь экран
XCUIApplication().buttons[XCUIIdentifierFullScreenWindow].click()
statusBar.openInFullScreen()
XCUIApplication().buttons["Group in Container"].click()

//assertLabel(text: "Container")
Expand Down Expand Up @@ -113,13 +107,9 @@ final class CanvasTests: DesignerTests {

private func createNewFile() {
// Создаем новый документ
let menuBarsQuery = app.menuBars

let fileMenu = menuBarsQuery.menuBarItems["File"]
fileMenu.click()

let fileNewMenu = menuBarsQuery.menuItems["New"]
fileNewMenu.click()
statusBar
.clickFile()
.clickFileNew()
}

func drawRectangle() {
Expand Down