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 in XCode #39

Open
sohilpandya opened this issue Jun 13, 2017 · 2 comments
Open

UI Testing in XCode #39

sohilpandya opened this issue Jun 13, 2017 · 2 comments
Assignees

Comments

@sohilpandya
Copy link
Member

sohilpandya commented Jun 13, 2017

Attaching my findings on using UI Tests.

I've been researching UI Automation testing and XCode comes built in with the automation tools which will allow a user to do UI Testing.

The idea is very much like Daydream, where you start recording the user's movement through the screen and where they end up. The user can then test whether the action taken by the user has had any effect.

What was my plan?

I set out a simple goal of being able to track the user when they add a new project. The steps required for this are:

  • select add icon
  • type the word "Test"
  • select done
  • the user will be redirected to the tableViewController where we can check if there is a row which contains the text "Test"

How?

As long as we have UITest set up as a target for the project, it is straight forward to begin your journey in automation UI Testing.

  • Select the UITest file that was autogenerated

screen shot 2017-06-13 at 17 35 28

- Then select the record button when your cursor is placed inside the testExample() test

screen shot 2017-06-13 at 17 36 44

This will open up the simulator and it will now record every click that is made by you and convert it into code inside of testExample()

Issues
Here is where we come across our the first issue, when we record the test, delete the code and repeat the process, it creates a different set of code. 😟 For e.g.

// First time
//        let app = XCUIApplication() // This is one of the issues that pops up in UI Testing.
// Second time
//        let app = app2
  • Next step is run the test.

Issues
Here is where the next issue arises, the test created above where the user enters "Test" sometimes results in the automation test typing in "Est", "Tes", "es" but never the full word "Test". This means the test never passes.

### Next steps

  • I'll try to research just a little more to find out if it's me causing this issue or the feature for automation testing is actually buggy.
  • Next, I'll move onto a spike on Appium, which is an open source test automation software that works with native, hybrid and web apps.
@sohilpandya sohilpandya self-assigned this Jun 13, 2017
@sohilpandya sohilpandya changed the title UI Testing in XCode [WIP] UI Testing in XCode Jun 13, 2017
@sohilpandya sohilpandya changed the title [WIP] UI Testing in XCode UI Testing in XCode Jun 13, 2017
@nelsonic
Copy link
Member

@sohilpandya this deserves it's own mini-tutorial (markdown file + screencast). excited to see it! 🎉

@sohilpandya
Copy link
Member Author

update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants