Created
May 22, 2013 11:00
-
-
Save AdamSaleh/5626768 to your computer and use it in GitHub Desktop.
So, I wanted to create tests for https://SERVER/katello/notices, but wasn't sure how to make (go-to katello.notices/page) to take me there.
This is how I did it.
This file contains 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
(ns katello.notices | |
(:require [com.redhat.qe.auto.selenium.selenium :as sel :refer [browser]] | |
[katello :as kt] | |
[clojure.zip :as zip] | |
(katello [navigation :refer [browser-fn] :as nav] | |
[notifications :as notification] | |
[content-search :as cs] | |
[ui-common :as common] | |
[ui :as ui]))) | |
;; Nav | |
(nav/defpages (common/pages) ;;;;;;;;;;;;;;;;;;; PAGENAV | |
[::page]) ;;;;;;;;;;;;;;;;;;; PAGENAV | |
(defn notices-page-content [] | |
"Goes to notices page and returns table of notifications" | |
(nav/go-to ::page) | |
(->> "notification_list" | |
cs/get-string-of-html-element | |
cs/get-zip-of-xml-string | |
zip/node | |
;I want table to be formated as list of lists | |
(cs/node-content-as []) | |
;convert ["asdf"] to "asdf" and [] to "" | |
(map (partial map | |
#(cond (= % []) "" | |
(= 1 (count %)) (first %) | |
:else %))) | |
;add column names, so that table is searchable \w clojure.set | |
(map | |
(partial zipmap [:created :level :org :desc])))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment