Page MenuHomePhabricator

Test automation for key Section Translation workflows
Open, Needs TriagePublic

Description

An initial exploration about automatic test support (T259604) concluded that it was "pretty much impossible right now to have the tests running in the CI, so we'll run them before pushing the code on our local environment".

Now that some of the workflows for Section Translation are completed we can start to define some of those automated tests. The main Section Translation epic task (T243495) can provide an overview of key workflows, but QA engineers can suggest different ones to start automating based on their experience testing them manually and how prone these are to regressions.

Additional considerations

The future use of Vue3 may require to update the Cypress integration. However, starting to define tests now and migrating them once the new infrastructure is more solid seems to be the preferred path,

For automated tests we need to be careful on depending on real data that can change over time. For example, an article may no longer have a section present or missing. Please surface any challenges to make test defined to be solid, and we can explore how to improve the system.

Tickets capturing key workflows

Event Timeline

@zeljkofilipin pinging you to have this in your sights since I'm leaving the team.

Currently we have a proof of concept integration of cypress with our Vue based applicaiton. We do not have any actual tests. To use this integration meaningfully we need to start developing tests as per Cypress+Vue specification. Also, the same tests need to be actively maintained as some parts of UI can be changed as we add more features.

Note that we have not finalized Cypress as the frameworks to do this. Now that we are planning to move to Vue3, there may be better options to do UI testing that can better integrate with Vue.

There may be also challenges with setting up the system and test environment as SectionTranslation is quite unique in technical architecture and one of the early systems that use Vue with Single Page Application mode in WMF.

Hi @santhosh! @Jpita was the only one familiar with Cypress. Now that he's left, I would not recommend using Cypress. Many projects use our standard Selenium framework. (See Selenium/Reference/Example Code for the list of repositories.) If the project doesn't have any serious reason for not using it, that's what I would suggest for end-to-end tests (or tests that run in the browser).

If I understood you correctly, I agree that the first problem to solve is local development environment and how to set up the project in CI and the beta cluster (if you would like to test there).

@zeljkofilipin Cypress was my choice based on recommendations in Vue documentation to integrate with our Vue tooling. As far as I read selenium has no Vue integration, An e2e system need not worry much about which frameworks or programming library used, but the integration helps authoring the tests with faster feedback cycles and tooling integration.

Yes, more than which e2e framework we pick, the effort of maintaining tests and having a test environment to use it in meaningful way is important.

Currently we have a proof of concept integration of cypress with our Vue based applicaiton.

Can you link to the code?

@zeljkofilipin Cypress was my choice based on recommendations in Vue documentation to integrate with our Vue tooling. As far as I read selenium has no Vue integration, An e2e system need not worry much about which frameworks or programming library used, but the integration helps authoring the tests with faster feedback cycles and tooling integration.

Interesting. I've looked at their documentation, and they recommend a few tools, but not webdriverio (that our selenium framework uses). A couple of tools (cypress and nightwatch) have official plugins. I don't know anything about vue, so I can't tell why would it need an official plugin for e2e tool. Mediawiki doesn't have an official plugin for any tool and webdriverio works just fine.

Of course, you are free to pick whatever tool you prefer. I just wanted to say that if you pick cypress, you're on your own. Nobody else has any experience with it.

If you pick webdriverio, a few people from Quality-and-Test-Engineering-Team (including myself) can help. A few developers outside Quality-and-Test-Engineering-Team also have some experience with webdriverio. Quality-and-Test-Engineering-Team is actively working on updating the testing framework. (See T274579: Upgrade WebdriverIO to v7 in all repositories and T256626: Refactor WebdriverIO tests from sync to async mode.)

Discussing this in phabricator is not likely to get us anywhere. If you want to talk about it, feel free to set up a meeting with me.

zeljkofilipin raised the priority of this task from Medium to Needs Triage.Oct 31 2023, 4:22 PM

Change 1009766 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX e2e tests: Create test for section translation workflow (mobile)

https://gerrit.wikimedia.org/r/1009766

Change 1009476 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX e2e tests: Fix after suggestion fetching changes

https://gerrit.wikimedia.org/r/1009476

Change #1009476 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX e2e tests: Simplify dashboard suggestion tests to be more robust

https://gerrit.wikimedia.org/r/1009476