Page MenuHomePhabricator

Replace the selector to avoid failure on opening "Download as Pdf"
Closed, InvalidPublic

Description

The tests in ElectronPdfService comprises of two interfaces:

As shown in the pictures above, first the "Download as Pdf(Pic:1) " is clicked and then the "Download(Pic:2)" button is verified by the test.

But the test fails because the selector used to capture "Download as Pdf" is incorrect or does not exist, due to which the redirection to interface 2 (Pic:2) is failed and ultimately the test can't verify the "Download" button. For reference see paste: https://phabricator.wikimedia.org/P15708

Solution

The problem can be solved by replacing the selector which will be able to capture the "Download as Pdf" properly.

Event Timeline

@Sahilgrewalhere terminal output you have provided (P15708) does not show that you have configured ElectronPdfService locally. That's probably the reason the test you are running are failing.

If you are using mediawiki-docker as a local development environment, you have to set up ElectronPdfService locally. I've tried creating a simple setup, but I get the same error locally as you do. See MediaWiki-Docker/Extension/ElectronPdfService for my setup.

I've checked the extension page (Extension:ElectronPdfService) and it looks like it's more complicated to set up then what I have done. (It also says the extension is replaced with another tool.)

I have re-run our continuous integration on a recent patch (684683) and nothing failed. That means that when the ElectronPdfService is configured correctly, tests run fine.

See this job for example:

https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-selenium-docker/48426/console

(...) 
[Chrome 88.0.4324.182 linux #0-0] Spec: /workspace/src/extensions/ElectronPdfService/tests/selenium/specs/electronpdfservice.js
[Chrome 88.0.4324.182 linux #0-0] Running: Chrome (v88.0.4324.182) on linux
[Chrome 88.0.4324.182 linux #0-0] Session ID: a7025c4d-3115-4d9a-a256-081aa7acf50e
[Chrome 88.0.4324.182 linux #0-0]
[Chrome 88.0.4324.182 linux #0-0] ElectronPdfService
[Chrome 88.0.4324.182 linux #0-0]    ✓ pdf download button is visible
[Chrome 88.0.4324.182 linux #0-0]
[Chrome 88.0.4324.182 linux #0-0] 1 passing (2s)

(...)

Spec Files:	 1 passed, 1 total (100% completed) in 00:00:06 

(...)

Ok i get it ! it needs proton to be installed , also it needs RestBase, I was using the same setup that you mentioned above that's why the test were failing. Thanks for the info

I'm closing this task as invalid, since there's nothing wrong with the test. Please reopen if I misunderstood the problem.