Page MenuHomePhabricator

Add tests for embed.html
Closed, ResolvedPublic5 Story Points

Description

embed.html is fairly important to external users of the query service (especially Scholia), but is also pretty easy to break – most changes in index.html and also some in wikibase/config.js and wikibase/init.js need to be reflected in embed.html as well, but that’s often forgotten because developers only check that index.html still works.

We should add some integration tests that embed.html works as expected.
We don't want to spend too much time making sure every single case is covered.

TBA devs to decide on 1 single simple smoke test for the embed.html that would covered caes that would leave it totally broken.

Details

Related Gerrit Patches:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 27 2018, 1:52 PM
Lydia_Pintscher triaged this task as High priority.Dec 29 2018, 9:21 PM
Lydia_Pintscher moved this task from incoming to ready to go on the Wikidata board.
Addshore lowered the priority of this task from High to Low.Feb 21 2019, 10:42 AM
Addshore updated the task description. (Show Details)
Addshore moved this task from Incoming to Ready to estimate on the Wikidata-Campsite board.
Addshore added a subscriber: Addshore.

@Lucas_Werkmeister_WMDE if you can think of a good test case / thing to check for to cover the ways this has broken before then please add it to this ticket.

A query using VALUES is probably a good candidate, something like this:

SELECT ?item ?itemLabel ?other WHERE {
  VALUES (?item ?itemLabel ?other) {
    (wd:Q42 "Douglas Adams"@en "1952-03-11T00:00:00Z"^^xsd:dateTime)
    (wd:Q80 "Tim Berners-Lee"@de <http://commons.wikimedia.org/wiki/Special:FilePath/Sir%20Tim%20Berners-Lee%20%28cropped%29.jpg>)
  }
}

And we could check that the result shows a table and that the following strings appear somewhere in it:

  • wd:Q42 (item IDs are abbreviated)
  • Douglas Adams
  • March 11, 1952 (date values are rendered)
  • wd:Q80
  • Tim Berners-Lee (non-English values are supported)
  • commons:Sir Tim Berners-Lee (cropped).jpg (Commons links are abbreviated)
alaa_wmde set the point value for this task to 5.Mar 5 2019, 4:14 PM

Change 499491 had a related patch set uploaded (by Greta WMDE; owner: Greta Doçi):
[wikidata/query/gui@master] Add integration test for embed.html using wdio

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

We added only one test to make sure that embed.html its functioning for now. More tests can be added as needed.

Change 499491 merged by jenkins-bot:
[wikidata/query/gui@master] Add integration test for embed.html using wdio

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

And we could check that the result shows a table and that the following strings appear somewhere in it:

  • wd:Q42 (item IDs are abbreviated)
  • Douglas Adams
  • March 11, 1952 (date values are rendered)
  • wd:Q80
  • Tim Berners-Lee (non-English values are supported)
  • commons:Sir Tim Berners-Lee (cropped).jpg (Commons links are abbreviated)

At the moment, the test doesn’t implement these checks, it just checks whether any query results are present at all. Is that enough to close this task?