Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Tests
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Sep 2018 at 10:47 UTC
Updated:
4 Oct 2023 at 04:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
zaporylieI'm wondering if it is not enough to just swap BrowserTestBase for WebDriverTestBase in CommerceBrowserTestBase and remove some overrides we add in JavascriptTestTrait. Let's see how will it go.
Comment #4
zaporylieAh, of course, CommerceBrowserTestBase is also used by Functional tests - stupid me. Well, IMHO we should go for a new base class - CommerceWebDriverTestBase. And perhaps deprecate the JavascriptTestTrait there altogether?
Comment #5
mglamanzaporylie the trait was used to make it easier to share a base class and common helpers across Functional and FunctionalJavascript tests. It probably would have been easier to share core's base classes and create our own helper traits. I think the biggest part was simplifying
setUpacross classes.It would probably be best to extend core classes so we don't lose on improvements, and just create helper test traits
Comment #6
zaporylieI had the same conclusion after seeing tests failing and reading codebase focusing on how the tests were structured. And I agree that extracting reusable methods from each of the base classes and move it to the respective trait that will be later used across Functional and/or FunctionalJavascript tests is the way to go here. I don't have time to do it at this minute but I'll make a patch later this weekend.
Thanks for taking the time to answer here @mglaman.
Comment #7
zaporylieThat will still fail but this time only about web driver incompatible tests.
Comment #9
zaporylieUps, I should have checked that one before posting the patch.
Comment #11
zaporylieThat looks much better 😊
Comment #12
mglamanThank you so much for this. Now we just need to fix any status check calls it looks like.
Comment #13
zaporylieThat should fix most of the tests. In fact, I only expect one remaining failure:
What's the value of the following test code? Can we simply remove it?
----
Edit:
BTW Something really strange happens when you set the value for date input (@see PromotionTest::testCreatePromotionWithEndDate). I had to change the format and the date itself so that it doesn't start with 0. I feel like this is an issue with chromedriver but couldn't easily debug it so I gave up and just changed the date.
Comment #15
mglamanIt's our big_pipe integration test. We'll have to see how the core big_pipe tests were migrated.
Comment #16
zaporylieBut what's the exact reason we're checking if the headers are (not) ''? Is it used to ensure the page was loaded using big_pipe?
I can't find any test and/or patch file that would suggest there was a FunctionalJavascript test in core's big_pipe module that was using responseHeaderNotEquals/responseHeaderEquals in the past.
I only found this - https://github.com/drupalcommerce/commerce/pull/756#discussion_r126111860 - which is where we started testing this header in the first place.
Comment #17
mglamanIt's probably safe to remove that test based on Wim's comments:
It is only present as an assert in big_pipe's Functional test. Let's purge those assertions.
Comment #18
zaporylieIt was my impression that these two assertions should just be removed. That's good we agree 👍
Comment #19
bojanz commentedThis looks good at a glance. Now we need to figure out how to make the tests work on Travis. That might require a PR to https://github.com/LionsAd/drupal_ti
Comment #20
mglamanPanopoly uses Chromedriver: https://github.com/panopoly/panopoly/blob/7.x-1.x/.travis.yml
I think if we export the MINK_ARGS properly it could "just work" when it comes to TravisCI.
@bojanz so we'd need to take that patch + adjustments to .travis.yml and prop it up on GitHub as a PR, yeah?
Comment #21
zaporylieI am testing it now here - https://travis-ci.org/zaporylie/commerce/jobs/448019594
Seems to be working fine 🎊
Comment #22
zaporylieor is it really :/
Jobs were terminated after 50 minutes due to a maximum time limit. Not sure if that's travis being slow or something wrong with the chromedriver.
Comment #23
zaporylieIt must be something related to the modified webdriver setup. The time spent on Unit/Kernel/Functional is more or less the same as before but FunctionalJavascript takes much longer.
Comment #24
mglamanWorking on pushing this to the end. Got it working 2/3 of the times.
Comment #25
mglamanHere are the results: https://travis-ci.org/mglaman/commerce/builds/457635900
With chromedriver we can use concurrency. So I set FunctionalJavascript to 5, just to keep builds faster.
Comment #26
mglamanWaiting to
commitpush once https://travis-ci.org/drupalcommerce/commerce passesComment #28
mglamanWoo! Committed. Thanks, zaporylie 👏👏👏👏
Comment #32
Neha Mahajan commented