From 0d862e719d5112a7935279679faa276174d34428 Mon Sep 17 00:00:00 2001 From: Ivan ROGER Date: Wed, 26 Feb 2020 11:49:38 +0100 Subject: [PATCH] Add support for multi-host Currently this library only allows page to be registered for one host, by adding a `PAGE_HOST` attribute to the page object we can now have page objects for different hosts. --- PageObjectLibrary/keywords.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PageObjectLibrary/keywords.py b/PageObjectLibrary/keywords.py index ba3d421..2fd733c 100644 --- a/PageObjectLibrary/keywords.py +++ b/PageObjectLibrary/keywords.py @@ -94,6 +94,8 @@ def go_to_page(self, page_name, page_root=None): url = page_root if page_root is not None else page.selib.get_location() (scheme, netloc, path, parameters, query, fragment) = urlparse(url) + if hasattr(page, 'PAGE_HOST'): + netloc = page.PAGE_HOST url = "%s://%s%s" % (scheme, netloc, page.PAGE_URL) with page._wait_for_page_refresh():