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

UI Testing Bundle #921

Merged
merged 8 commits into from
Mar 15, 2021
Merged

UI Testing Bundle #921

merged 8 commits into from
Mar 15, 2021

Conversation

CKuB
Copy link
Contributor

@CKuB CKuB commented Mar 12, 2021

YouTrack task: #SQA-806

Description:
Tests for splash, notifications allowing and unregistered user UI

@CKuB CKuB added the UITests label Mar 12, 2021
@CKuB CKuB added this to the 1.165 milestone Mar 12, 2021
@CKuB CKuB requested a review from ivan-magda March 12, 2021 08:55
@CKuB CKuB self-assigned this Mar 12, 2021
@github-actions github-actions bot added dependencies Pull requests that update a dependency file main labels Mar 12, 2021
@CKuB CKuB changed the base branch from master to dev March 12, 2021 08:58
@ivan-magda ivan-magda changed the title Stepic UI tests - first 5 tests UI Testing Bundle Mar 12, 2021
@ivan-magda ivan-magda removed the dependencies Pull requests that update a dependency file label Mar 12, 2021
Copy link
Member

@ivan-magda ivan-magda left a 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 {
Copy link
Member

Choose a reason for hiding this comment

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

Настройка состояния не может бросить ошибку, поэтому можно использовать обычный метод setUp().

Suggested change
override func setUpWithError() throws {
override func setUp() {
super.setUp()

XCUIApplication().launchArguments += ["-AppleLocale", "en_EN"]
}

override func tearDownWithError() throws {
Copy link
Member

Choose a reason for hiding this comment

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

Очистка состояния не может бросить ошибку, поэтому можно использовать обычный метод tearDown()

Suggested change
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")
Copy link
Member

Choose a reason for hiding this comment

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

У меня тест переодически падает на этом месте, видимо здесь следует добавить таймаут .waitForExistence(timeout: 1).

Comment on lines 209 to 216
/*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()
}
}
} */
Copy link
Member

Choose a reason for hiding this comment

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

Можно удалить

Comment on lines 31 to 32
// Put the app in the background
//XCUIDevice.shared.press(XCUIDevice.Button.home)
Copy link
Member

Choose a reason for hiding this comment

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

Если не нужно, то можно удалить.

AKholin added 2 commits March 15, 2021 18:48
#SQA-806
#SQA-806
@CKuB CKuB requested a review from ivan-magda March 15, 2021 17:32
@ivan-magda ivan-magda merged commit e1d11a6 into dev Mar 15, 2021
@ivan-magda ivan-magda deleted the StepicUITests branch March 15, 2021 20:33
@ivan-magda ivan-magda mentioned this pull request Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants