Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Fixes #1169: Add a test for the no internet connection page #1644

Closed
wants to merge 2 commits into from

Conversation

vldmrkl
Copy link
Contributor

@vldmrkl vldmrkl commented Feb 14, 2019

This PR contains a fix for #1164.

I added a XCUI test for this page. I learned that there is no way to turn off network on iOS Simulator programatically, so in order to use this test, you should turn off network on your computer, where you run the project.

Also, I added a check for the internet connectity. If there is no internet connectivity – test runs. In order to implement it, I referenced this article.

CC: @oliviabrown9

@oliviabrown9
Copy link
Contributor

@farhanpatel does Firefox iOS have any UI tests that check how the app handles connectivity issues? I'm not sure that such a test would be helpful since it requires manually turning off connectivity on the physical device (and thus would never be run on BuddyBuild) based on the info in this PR. How has Firefox iOS handled it or do you have advice for how we could handle it here?

@farhanpatel
Copy link

Hey @oliviabrown9 , So sorry I saw this late. We don't have any tests that I know of that test no network connectivity. We have tests to test things like FxA being down or Pocket not returning trending stories. But these are usually done by stubbing the API. Blocking all internet traffic to simulate offline isn't something we've tried.

I wonder if you could use NSAppTransportSecurity in the info.plist to do this. You might need a different scheme just for these offline tests.

@st3fan
Copy link
Contributor

st3fan commented May 20, 2021

I like more tests and this specific case is an area we don't cover well. Let's investigate if we can run this in a way with the network disabled or maybe with a mocked API.

@st3fan
Copy link
Contributor

st3fan commented May 27, 2021

@isabelrios what do you think of this one? not sure if we should keep it around or close it.

@isabelrios
Copy link
Collaborator

@isabelrios what do you think of this one? not sure if we should keep it around or close it.

Oh sorry I missed this comment and it is been more than two weeks, I will take a look soon

@isabelrios
Copy link
Collaborator

I have rebased latest main and checked this test. It looks like it is passing in all scenarios, don't think it is working as it is now.

@vldmrkl I know it is been a while, not sure whether you will be interested in contributing still. I think this is a nice test to have but it will need some work.

}

func testConnectivity() {
if !ReachabilityTest.isConnectedToNetwork() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This if statement is never reached. The connection is always on and so the test always pass, in order to make this test checking when the device is offline we would need to force that status on the device for it and so be able to check what happens.

@isabelrios
Copy link
Collaborator

Let's close for now and re-open if needed/requested in the future

@isabelrios isabelrios closed this Jul 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants