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

Feature/Added tvOS-UITests #27

Merged
merged 5 commits into from
Oct 14, 2018
Merged

Conversation

FraDeliro
Copy link

Purpose

This is a feature to add UITests for tvOS.

A brief description of what has changed and why it has changed

Added:

  • Example_tvOSUITests.swift

Ways to test feature or scenarios to try

Run the tests for tvOS example app.

XCUIRemote.shared.press(.select)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Option 3").element, handler: nil)

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 128 characters (line_length)
Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)

XCUIRemote.shared.press(.select)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Option 2").element, handler: nil)

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 128 characters (line_length)
Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)

XCUIRemote.shared.press(.select)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Option 1").element, handler: nil)

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 128 characters (line_length)
Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)

XCUIRemote.shared.press(.select)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:".value2").element, handler: nil)

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 127 characters (line_length)
Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)

waitForExpectations(timeout: 5, handler: nil)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:".value1").element, handler: nil)

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 127 characters (line_length)
Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)

waitForExpectations(timeout: 5, handler: nil)
XCUIRemote.shared.press(.select)

expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Tap action").element, handler: nil)

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 130 characters (line_length)
Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)

XCUIRemote.shared.press(.select)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Tap action").element, handler: nil)

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 130 characters (line_length)
Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)

XCUIRemote.shared.press(.select)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Setting 2").element, handler: nil)

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 129 characters (line_length)
Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)

let existance = NSPredicate(format: "exists == true")
let hasFocus = NSPredicate(format: "hasFocus == true")

expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Setting 1").element, handler: nil)

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 129 characters (line_length)
Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)

app.launch()
}

func testInteractions() {

Choose a reason for hiding this comment

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

Function Body Length Violation: Function body should span 40 lines or less excluding comments and whitespace: currently spans 57 lines (function_body_length)

Copy link
Owner

Choose a reason for hiding this comment

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

I think houndci has the wrong configuration. I'll fix it later.

@codecov
Copy link

codecov bot commented Oct 7, 2018

Codecov Report

Merging #27 into develop will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop      #27   +/-   ##
========================================
  Coverage    94.71%   94.71%           
========================================
  Files           12       12           
  Lines          284      284           
========================================
  Hits           269      269           
  Misses          15       15

@FraDeliro FraDeliro mentioned this pull request Oct 7, 2018

import XCTest

internal final class Example_tvOSUITests: XCTestCase {
Copy link
Owner

Choose a reason for hiding this comment

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

Can you rename the file and class to ExampleUITests without the underscore?

app.launch()
}

func testInteractions() {
Copy link
Owner

Choose a reason for hiding this comment

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

I think houndci has the wrong configuration. I'll fix it later.

DevelopmentTeam = NQU669U9J9;
ProvisioningStyle = Automatic;
TestTargetID = B54A24522088D44A00EEBA26;
};
Copy link
Owner

Choose a reason for hiding this comment

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

You probably want to remove your team ID from the project.

@bcylin
Copy link
Owner

bcylin commented Oct 8, 2018

Thanks for the pull request! Currently CI doesn't run Example-tvOSUITests. Can you also change bundle exec rake "build:tvos[Example-tvOS]" to test:tvos[Example-tvOS] in .travis.yml?

XCUIRemote.shared.press(.select)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Option 3").element, handler: nil)

Choose a reason for hiding this comment

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

Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)
Line Length Violation: Line should be 120 characters or less: currently 128 characters (line_length)

XCUIRemote.shared.press(.select)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Option 2").element, handler: nil)

Choose a reason for hiding this comment

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

Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)
Line Length Violation: Line should be 120 characters or less: currently 128 characters (line_length)

XCUIRemote.shared.press(.select)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Option 1").element, handler: nil)

Choose a reason for hiding this comment

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

Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)
Line Length Violation: Line should be 120 characters or less: currently 128 characters (line_length)

XCUIRemote.shared.press(.select)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:".value2").element, handler: nil)

Choose a reason for hiding this comment

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

Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)
Line Length Violation: Line should be 120 characters or less: currently 127 characters (line_length)

waitForExpectations(timeout: 5, handler: nil)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:".value1").element, handler: nil)

Choose a reason for hiding this comment

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

Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)
Line Length Violation: Line should be 120 characters or less: currently 127 characters (line_length)

waitForExpectations(timeout: 5, handler: nil)
XCUIRemote.shared.press(.select)

expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Tap action").element, handler: nil)

Choose a reason for hiding this comment

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

Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)
Line Length Violation: Line should be 120 characters or less: currently 130 characters (line_length)

XCUIRemote.shared.press(.select)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Tap action").element, handler: nil)

Choose a reason for hiding this comment

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

Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)
Line Length Violation: Line should be 120 characters or less: currently 130 characters (line_length)

XCUIRemote.shared.press(.select)

XCUIRemote.shared.press(.down)
expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Setting 2").element, handler: nil)

Choose a reason for hiding this comment

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

Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)
Line Length Violation: Line should be 120 characters or less: currently 129 characters (line_length)

let existance = NSPredicate(format: "exists == true")
let hasFocus = NSPredicate(format: "hasFocus == true")

expectation(for: hasFocus, evaluatedWith: tables.cells.containing(.staticText, identifier:"Setting 1").element, handler: nil)

Choose a reason for hiding this comment

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

Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)
Line Length Violation: Line should be 120 characters or less: currently 129 characters (line_length)

app.launch()
}

func testInteractions() {

Choose a reason for hiding this comment

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

Function Body Length Violation: Function body should span 40 lines or less excluding comments and whitespace: currently spans 57 lines (function_body_length)

app.launch()
}

func testInteractions() {
Copy link
Owner

Choose a reason for hiding this comment

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

Please try adding // swiftlint:disable function_body_length line_length above the method for the temporary fix. Sorry about @houndci-bot.

Copy link
Author

Choose a reason for hiding this comment

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

No worries ;) 👍

@bcylin
Copy link
Owner

bcylin commented Oct 10, 2018

Can you fix the colon violations and rebase the latest develop branch?

Colon Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. (colon)

@bcylin bcylin merged commit 8786e6e into bcylin:develop Oct 14, 2018
@bcylin
Copy link
Owner

bcylin commented Oct 14, 2018

Thanks @FraDeliro!

@FraDeliro
Copy link
Author

Thank you @bcylin ;)

@FraDeliro FraDeliro deleted the feature/add-tvOSUITests branch October 16, 2018 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants