Skip to content

Running androidTests in Travis #2226

Closed
Closed
@domdomegg

Description

@domdomegg

Summary:

I was thinking about how to write a load of espresso tests (see #586) for the app to try to prevent so many bugs cropping up.

To get good coverage, we'd need to be a logged in user. So the tests would be more standardised, I think it would be useful to have a test user the tests could login as.

Therefore I think it would be useful to have an account on beta commons (and maybe even on real/prod commons) which isn't able to do anything - not even edit its own user talk page, or change its own password. Maybe:

  • Create the account
  • Upload a few test photographs (so the 'home' page is not blank)
  • Get it 'locked' somehow

It also might be useful to have a similar test user which is a completely blank account (i.e. no uploads), as I could imagine that causing bugs in the app which we want to test for (#2154).

We could then safely commit its credentials to this repo so people can run the tests. There also might be a different way that doesn't involve sharing credentials, if people have one please do suggest!

The alternate idea I had:

  • Require developers to create their own test accounts according to some specific instructions and then
    • Log in to the app in the emulator and then run the test suite
    • Put their credentials in a file that is not commited to the repo (with some .gitignore rule)
  • Somehow Travis has its own credentials (kept secret like Google Play keys) and does its testing like that?

The issue with this is I can imagine a lot of new contributors accidentally pushing their credentials to Github. While this would be bad for beta commons, this could be very bad on real/prod commons. The setup would add an extra barrier to entry for developers to start regularly using automated testing, which we want to encourage by making as easy as possible. I also have no idea how to do the bit about Travis.

Would you like to work on the issue?

I don't really know how this would be done - hoping someone else here might. If not, I'm happy to post on the Commons helpdesk and see if we can get some answers.

Yes in terms of trying to add more android tests - although they're so broad and don't really conflict everyone is still free to (and should!) get writing tests. I'm not very good at it yet, but I'm trying to learn :)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions