-
Notifications
You must be signed in to change notification settings - Fork 35
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
UI Testing Bundle #921
UI Testing Bundle #921
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У нас есть свой Code Style Guide, желательно ознакомиться, т.к. сейчас есть проблемы с форматирование кода.
Я добавил линтер в тесты. Нужно будет запустить автокоррекцию ./Pods/SwiftLint/swiftlint --fix
из командной строки, а потом исправить оставшиеся ошибки.
Ну и на будущее лучше разделять тесты по смыслу, вынося в отдельные классы, чтобы под определённую фичу был свой набор тестов, а не все в одном файле.
class StepicUITests: XCTestCase { | ||
|
||
|
||
override func setUpWithError() throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Настройка состояния не может бросить ошибку, поэтому можно использовать обычный метод setUp()
.
override func setUpWithError() throws { | |
override func setUp() { | |
super.setUp() |
XCUIApplication().launchArguments += ["-AppleLocale", "en_EN"] | ||
} | ||
|
||
override func tearDownWithError() throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Очистка состояния не может бросить ошибку, поэтому можно использовать обычный метод tearDown()
override func tearDownWithError() throws { | |
override func tearDown() { |
let scrollViewsQuery = app.scrollViews | ||
let elementsQuery = scrollViewsQuery.otherElements | ||
|
||
XCTAssertTrue(elementsQuery.staticTexts["Editors' choice"].exists,"No Editors choice section") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У меня тест переодически падает на этом месте, видимо здесь следует добавить таймаут .waitForExistence(timeout: 1)
.
/*func testLaunchPerformance() throws { | ||
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { | ||
// This measures how long it takes to launch your application. | ||
measure(metrics: [XCTApplicationLaunchMetric()]) { | ||
XCUIApplication().launch() | ||
} | ||
} | ||
} */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно удалить
// Put the app in the background | ||
//XCUIDevice.shared.press(XCUIDevice.Button.home) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если не нужно, то можно удалить.
#SQA-806
#SQA-806
YouTrack task: #SQA-806
Description:
Tests for splash, notifications allowing and unregistered user UI