AAO-React-Native icon indicating copy to clipboard operation
AAO-React-Native copied to clipboard

đź§Ş Add end-to-end tests for navigation

Open rye opened this issue 6 years ago • 8 comments

I like testing.

Testing is good.

"We should test more stuff" has been a long-standing thing I've said, but here I'm actually trying my hand at e2e testing.

I'm Not Sure™ if this affects coverage at all. It'd be nice if it did, but I don't think Detox instruments that yet, or if they do, I don't think we're uploading that. So, I guess I just have to give this a try.


Courtesy of @drewvolz, I'm adding a to-do list of things I should look at:

Home

  • [ ] List of buttons

Menus

  • [ ] Stav Hall
  • [ ] Cage
  • [ ] Pause
  • [ ] Burton
  • [ ] LDC
  • [ ] Weitz
  • [ ] Sayles
  • [ ] Menu Item Detail

SIS

  • [ ] Balances
  • [ ] Course Search Home
  • [ ] Course Search List
  • [ ] Course Search Detail
  • [ ] TES
  • [ ] Open Jobs List
  • [ ] Open Jobs Detail

Building hours

  • [ ] Hours List
  • [ ] Hours Detail
  • [ ] Hours Problem Report
  • [ ] Hours Schedule Editor

Calendar

  • [ ] St. Olaf Calendar
  • [ ] Oleville Calendar
  • [ ] Northfield Calendar
  • [ ] Calendar Event Detail

Directory

  • [ ] Link to browser (current implementation)
  • [ ] Directory List (awaiting PR merge)
  • [ ] Directory Contact Detail (awaiting PR merge)

Streaming Media

  • [ ] Events calendar
  • [ ] Webcams
  • [x] KSTO Radio
  • [ ] KRLX Radio
  • [ ] Radio Schedule

News

  • [ ] St. Olaf List
  • [ ] Oleville List
  • [ ] Mess List
  • [ ] PoliticOle List
  • [ ] KSTO List

Map

  • [ ] Link to Browser

Important Contacts

  • [ ] Contacts List
  • [ ] Contacts Detail

Transit

  • [ ] Express Bus
  • [ ] Red Line
  • [ ] Blue Line
  • [ ] Oles Go
  • [ ] Other Modes
  • [ ] Other Modes Detail

Dictionary

  • [ ] Dictionary List
  • [ ] Dictionary Detail
  • [ ] Dictionary Editor

Student Orgs

  • [ ] Orgs List
  • [ ] Orgs Detail

Moodle

  • [ ] Link to Browser

Report a Problem

  • [ ] List of help cards

stoPrint

  • [ ] Printer List
  • [ ] Print Job Release

Safety Concerns

  • [ ] Link to Browser

Settings

  • [ ] Login
  • [ ] Contact Us
  • [ ] FAQs
  • [ ] Reset
  • [ ] Icon Settings
  • [ ] Credits
  • [ ] Privacy Policy
  • [ ] Legal
  • [ ] Contributing (link to browser)

Smaller Fish

Developer

  • [ ] API Test
  • [ ] BonApp Picker
  • [ ] Redux Debug
  • [ ] Sentry Message
  • [ ] Sentry Exception

Integrated but not visible

  • [ ] Bus Map

rye avatar Sep 15 '19 16:09 rye

Codecov Report

Merging #4013 (f64c56d) into master (c2358b2) will not change coverage. The diff coverage is 0.00%.

Additional details and impacted files
@@          Coverage Diff           @@
##           master   #4013   +/-   ##
======================================
  Coverage    8.59%   8.59%           
======================================
  Files         298     298           
  Lines        5097    5097           
  Branches     1383    1383           
======================================
  Hits          438     438           
  Misses       4636    4636           
  Partials       23      23           

codecov[bot] avatar Sep 15 '19 16:09 codecov[bot]

I think we should tweak the Detox tests to not reinstall the app before every test. I don’t remember why I did that originally.

hawkrives avatar Sep 15 '19 16:09 hawkrives

Anyway, ideas:

  • Calendar, tap first item in the list of there are any items

  • Building Hours, same thing

  • Settings, assert that the Sign In button is visible?

hawkrives avatar Sep 15 '19 16:09 hawkrives

I have taken care of the relaunching behavior in 6dd0d1f49456d4a8272beca47a224e9b3f8fdd43.

rye avatar Sep 15 '19 16:09 rye

So I can't find my testID because "React Native only supports the testID prop on the native built-in components."

It sounds like I have to manually propagate that through to the appropriate element.

rye avatar Sep 15 '19 18:09 rye

Hey, a passing build!

rye avatar Sep 15 '19 20:09 rye

List of views I think we could add E2E tests to. Feel free to edit.

Home

  • [ ] List of buttons

Menus

  • [ ] Stav Hall
  • [ ] Cage
  • [ ] Pause
  • [ ] Burton
  • [ ] LDC
  • [ ] Weitz
  • [ ] Sayles
  • [ ] Menu Item Detail

SIS

  • [ ] Balances
  • [ ] Course Search Home
  • [ ] Course Search List
  • [ ] Course Search Detail
  • [ ] TES
  • [ ] Open Jobs List
  • [ ] Open Jobs Detail

Building hours

  • [ ] Hours List
  • [ ] Hours Detail
  • [ ] Hours Problem Report
  • [ ] Hours Schedule Editor

Calendar

  • [ ] St. Olaf Calendar
  • [ ] Oleville Calendar
  • [ ] Northfield Calendar
  • [ ] Calendar Event Detail

Directory

  • [ ] Link to browser (current implementation)
  • [ ] Directory List (awaiting PR merge)
  • [ ] Directory Contact Detail (awaiting PR merge)

Streaming Media

  • [ ] Events calendar
  • [ ] Webcams
  • [ ] KSTO Radio
  • [ ] KRLX Radio
  • [ ] Radio Schedule

News

  • [ ] St. Olaf List
  • [ ] Oleville List
  • [ ] Mess List
  • [ ] PoliticOle List
  • [ ] KSTO List

Map

  • [ ] Link to Browser

Important Contacts

  • [ ] Contacts List
  • [ ] Contacts Detail

Transit

  • [ ] Express Bus
  • [ ] Red Line
  • [ ] Blue Line
  • [ ] Oles Go
  • [ ] Other Modes
  • [ ] Other Modes Detail

Dictionary

  • [ ] Dictionary List
  • [ ] Dictionary Detail
  • [ ] Dictionary Editor

Student Orgs

  • [ ] Orgs List
  • [ ] Orgs Detail

Moodle

  • [ ] Link to Browser

Report a Problem

  • [ ] List of help cards

stoPrint

  • [ ] Printer List
  • [ ] Print Job Release

Safety Concerns

  • [ ] Link to Browser

Settings

  • [ ] Login
  • [ ] Contact Us
  • [ ] FAQs
  • [ ] Reset
  • [ ] Icon Settings
  • [ ] Credits
  • [ ] Privacy Policy
  • [ ] Legal
  • [ ] Contributing (link to browser)

Smaller Fish

Developer

  • [ ] API Test
  • [ ] BonApp Picker
  • [ ] Redux Debug
  • [ ] Sentry Message
  • [ ] Sentry Exception

Integrated but not visible

  • [ ] Bus Map

drewvolz avatar Sep 20 '19 22:09 drewvolz

I realize these have been sitting in this PR but probably can be merged in as they are written. Is there anything besides resolving conflicts that we need to do to get these in?

drewvolz avatar May 28 '22 06:05 drewvolz

Riffing from @drewvolz's comment, I think that once we get Detox working again this should be only a small amount of work to merge!

hawkrives avatar Jan 20 '23 23:01 hawkrives

  ● Streaming Media View › has the Stream List visible by default

    Test Failed: No elements found for “MATCHER(id == “homescreen-button-StreamingView”)”

    HINT: To print view hierarchy on failed actions/matches, use log-level verbose or higher.

      30 | 	it('has the Stream List visible by default', async () => {
      31 | 		// Navigate into StreamingView
    > 32 | 		await element(by.id('homescreen-button-StreamingView')).tap()
         | 		                                                        ^
      33 |
      34 | 		// The stream-list should be visible now
      35 | 		await expect(element(by.id('stream-list'))).toBeVisible()

      at Object.<anonymous> (e2e/streaming.spec.ts:32:59)

Working on this part next…

hawkrives avatar Jan 24 '23 16:01 hawkrives

ready!

hawkrives avatar Jan 24 '23 22:01 hawkrives

I fully agree! And I agree about that being a separate effort - we'll get a lot of value just from having the assurance that every view is reachable by navigating the app, I think!

hawkrives avatar Jan 25 '23 01:01 hawkrives