Commit 8349fd0a by Csók Tamás

html tag got data- prefix

parent b57ec70b
......@@ -5,7 +5,7 @@
{% for a in activities %}
<div class="activity{% if a.pk == active.pk %} activity-active{%endif%}"
data-activity-id="{{ a.pk }}" data-activity-code="{{ a.activity_code }}" timestamp="{{ a.started|date:"U" }}">
data-activity-id="{{ a.pk }}" data-activity-code="{{ a.activity_code }}" data-timestamp="{{ a.started|date:"U" }}">
<span class="timeline-icon{% if a.has_failed %} timeline-icon-failed{% endif %}">
<i class="fa {% if not a.finished %}fa-refresh fa-spin {% else %}fa-{{a.icon}}{% endif %}"></i>
</span>
......
......@@ -37,6 +37,17 @@ logger = logging.getLogger(SeleniumConfig.logger_name)
class SeleniumMixin(object):
def current_url(self):
url_base = urlparse.urlparse(self.driver.current_url)
url_save = ("%(host)s%(url)s" % {
'host': self.conf.host,
'url': urlparse.urljoin(url_base.path, url_base.query)})
if url_base.fragment:
url_save = ("%(url)s#%(fragment)s" % {
'url': url_save,
'fragment': url_base.fragment})
return url_save
def list_options(self, select):
try:
option_dic = {}
......@@ -244,10 +255,7 @@ class CircleSeleniumMixin(SeleniumMixin):
def save_template_from_vm(self, name):
try:
url_base = urlparse.urlparse(self.driver.current_url)
url_save = ("%(host)s%(url)s" % {
'host': self.conf.host,
'url': urlparse.urljoin(url_base.path, url_base.query)})
url_save = self.current_url()
WebDriverWait(self.driver, self.conf.wait_max_sec).until(
ec.element_to_be_clickable((
By.CSS_SELECTOR,
......@@ -404,14 +412,7 @@ class CircleSeleniumMixin(SeleniumMixin):
"""
try:
if restore:
url_base = urlparse.urlparse(self.driver.current_url)
url_save = ("%(host)s%(url)s" % {
'host': self.conf.host,
'url': urlparse.urljoin(url_base.path, url_base.query)})
if url_base.fragment:
url_save = ("%(url)s#%(fragment)s" % {
'url': url_save,
'fragment': url_base.fragment})
url_save = self.current_url()
self.driver.get('%(host)s/dashboard/vm/activity/%(id)s/' % {
'host': self.conf.host,
'id': operation_id})
......@@ -512,7 +513,7 @@ class CircleSeleniumMixin(SeleniumMixin):
logger.warning("Found activity list for %s:" % code_text)
for activity in searched_activity:
activity_id = activity.get_attribute('data-activity-id')
key = activity.get_attribute('timestamp')
key = activity.get_attribute('data-timestamp')
logger.warning("%(id)s @ %(activity)s" % {
'id': activity_id,
'activity': datetime.fromtimestamp(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment