如何使用Codeception / Selenium WebDriver测试URL是否为HTTPS

I want to acceptance-test a legacy e-commerce site.

Its product pages are served over HTTP; mod_rewrite redirects ensure that the cart and checkout pages are HTTPS. I want to test that, when I click "Add to cart" in a product page, the next page (shopping cart) is HTTPS.

But it fails when

$I->seeInCurrentUrl('https');

because the current URL is only the URI part, /my_cart.

Is there a way I can test against the full URL?

I suppose the most easy way is to use executeJS function, like this:

$url = $I->executeJS("return location.href");
$I->assertContains("https://", $url);