This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn check-for-error | |
"Gets any notification and checks if error, if not error, does | |
nothing. If error throws exception." | |
(let [notif (notification) | |
msg (:msg notif)] | |
(cond ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn check-for-error | |
[ & [timeout]] | |
(try+ (check-for-success timeout) | |
(catch ::no-success-message-error _ nil))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn extract-left-pane-list [loc] | |
(let [elems (for [index (iterate inc 1)] | |
(loc (str index))) | |
;(locators/left-pane-field-list (str index))) | |
retrieve (fn [elem] | |
(try (browser getText elem) | |
(catch Exception e nil)))] | |
(->> (map retrieve elems) (take-while identity) set))) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_system_by_name(self): | |
locator = (By.XPATH, "//div[@class='one-line-ellipsis']") | |
systems_in_list = [element.text for element in self.selenium.find_elements(*locator)] | |
return systems_in_list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="system_97" class="block tall" data-ajax_url="/headpin/systems/97/edit" style="width: 358px;"> | |
<div> | |
<div class="column_2"> | |
<div class="product"> | |
<div class="one-line-ellipsis" style="padding-top: 2px;"> newsystem2820 </div> | |
</div> | |
<div class="column_2"> Never checked in. </div> | |
</div> | |
<div> | |
<div class="arrow-right"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_system_list_locator = (By.CSS_SELECTOR, "div.block.tall") | |
def create_new_virt_system(self, system_name): | |
''' Create a new system ''' | |
new_system_link_locator = self.selenium.find_element(*self._systems_create_new_locator) | |
ActionChains(self.selenium).move_to_element(new_system_link_locator).\ | |
click().perform() | |
system_name_locator = self.selenium.find_element(*self._new_systemname_field_locator) | |
system_name_locator.send_keys(system_name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
save_button_locator = self.selenium.find_element(*self._new_system_save_locator) | |
ActionChains(self.selenium).move_to_element(save_button_locator).\ | |
click().perform() | |
WebDriverWait(self.selenium, 20).until(lambda s: len(self.systems) > 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_successful(self): | |
return self.is_element_present(*self._success_notification_locator) | |
@property | |
def is_failed(self): | |
return self.is_element_present(*self._error_notification_locator) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import base64 | |
import httplib | |
import urllib | |
try: | |
import json | |
except ImportError: | |
import simplejson as json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import base64 | |
import httplib | |
import urllib | |
import locale | |
import os | |
import mimetypes | |
try: |
OlderNewer