theextremeprogrammer / Succinct

UI tests at the speed of unit tests. Proper encapsulation. Architecture agnostic. Freedom to refactor.
MIT License
42 stars 7 forks source link

Finds UILabels in the navigation bar #2

Closed immenor closed 6 years ago

immenor commented 6 years ago

Added the ability for hasLabel to find the viewController's title, for hasLabel and findLabel to search the navigationItem's titleView, and the navigationController's view.

codecov-io commented 6 years ago

Codecov Report

Merging #2 into master will increase coverage by 0.92%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #2      +/-   ##
==========================================
+ Coverage   92.89%   93.81%   +0.92%     
==========================================
  Files          79       82       +3     
  Lines        2363     2717     +354     
==========================================
+ Hits         2195     2549     +354     
  Misses        168      168
Impacted Files Coverage Δ
...tainerTests/Builders/UIViewControllerBuilder.swift 100% <ø> (ø) :arrow_up:
...Tests/Builders/UINavigationControllerBuilder.swift 100% <100%> (ø)
...ct/UIViewController/UIViewController+UILabel.swift 100% <100%> (ø) :arrow_up:
...ontroller/UINavigationController+UILabelSpec.swift 100% <100%> (ø)
...ccinctTests/Builders/UIViewControllerBuilder.swift 100% <100%> (ø) :arrow_up:
...ionController/UINavigationController+UILabel.swift 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a069dfe...e9ec00c. Read the comment docs.

immenor commented 6 years ago

I committed the changes you mentioned above! Hopefully I didn't miss anything, it is getting a bit late :P

theextremeprogrammer commented 6 years ago

@immenor I recently added integration with CodeCov and its interesting to see their data and reports. Can you take a look at this code cov report?

https://codecov.io/gh/derekleerock/Succinct/compare/a069dfe516137976e45966f878512fd4e995a618...ce03f556fc4153d728e7428eb3d110a9fa2b449b/diff

It looks like "func hasLabelInNavigationBar(withExactText searchText: String) -> Bool?" does not have any code coverage. Also, for the following methods:

... it looks like there aren't any test cases for the "return false" or "return nil" cases.

If you take a look at this commit (https://github.com/derekleerock/Succinct/commit/2c8e0e1276b0a0c3dee893fc248d90355ad93ff7) you'll see that I started to add some test cases for this scenario (when the label text cannot be found) as an example.

Could I trouble you to add test cases around these? Thanks!!

immenor commented 6 years ago

@derekleerock the code coverage stuff is pretty cool! I will add these cases. Do you know if there is a way for me to check the code coverage locally before I push up to this branch?