Skip to content

Commit

Permalink
Add comment in GalleryTemplateTest to explain why we pass query par…
Browse files Browse the repository at this point in the history
…ameter in tested url

Co-authored-by: George B <[email protected]>
  • Loading branch information
ioannakok and georgeblahblah committed Jan 23, 2024
1 parent bab523a commit e762f8e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions applications/test/GalleryTemplateTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ import scala.jdk.CollectionConverters._
)
}

// The Play framework runs integration tests with a TestBrowser that uses a Selenium WebDriver.
// Play 2.9 changes the version of Selenium it depends on under the hood from 3.141.59 to 4.14.1.
// In the previous version of the code the tests above could run one after the other
// without the first affecting the outcome of the second. This is not true anymore,
// it looks like the TestBrowser we use in our test configuration does not automatically clear its cache after each test
// so the second test will always fail. We have similar result if we swap the tests.
// In the following two tests we're adding a flag in the url to make sure
// the cache gets cleared and the tests run independently.
// TODO: Find a way to clear the Selenium WebDriver cache programmatically: https://github.com/guardian/frontend/issues/26837
it should "select the trail picture for the opengraph image when FacebookShareUseTrailPicFirstSwitch is ON" in {
FacebookShareUseTrailPicFirstSwitch.switchOn()
goTo("/lifeandstyle/gallery/2014/nov/24/flying-dogs-in-pictures?page=on") { browser =>
Expand Down

0 comments on commit e762f8e

Please sign in to comment.