Produced by Araxis Merge on 10/3/2017 11:16:07 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | ehmp.zip\ehmp\ehmp\product\tests\acceptance-tests\features_leipr\steps | JLV_PerformanceTesting.rb | Tue Dec 15 14:05:18 2015 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\tests\acceptance-tests\features_leipr\steps | JLV_PerformanceTesting.rb | Tue Oct 3 14:22:18 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 6 | 292 |
| Changed | 5 | 14 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | path = Fil e.expand_p ath '..', __FILE__ | |
| 2 | $LOAD_PATH .unshift p ath unless $LOAD_PAT H.include? (path) | |
| 3 | path = Fil e.expand_p ath '../.. /../../sha red-test-r uby', __FI LE__ | |
| 4 | $LOAD_PATH .unshift p ath unless $LOAD_PAT H.include? (path) | |
| 5 | ||
| 6 | require "r spec/expec tations" | |
| 7 | require "h ttparty" | |
| 8 | require "j son" | |
| 9 | require "s elenium-we bdriver" | |
| 10 | require 'F indElement Factory.rb ' | |
| 11 | require 'W ebDriverFa ctory.rb' | |
| 12 | require 'C ommonDrive r.rb' | |
| 13 | require 'S eleniumCom mand.rb' | |
| 14 | ||
| 15 | def append _output_to _file(file _path, res ponse_time _desc, tot al_time) | |
| 16 | file = F ile.open(f ile_path, 'a') | |
| 17 | file.wri te('Date= ' + Time.n ow.to_s + '; Seleniu m id= '+ @ @web_drive r.to_s + ' ; ' + resp onse_time_ desc + "= '#{total_t ime}' Sec" +"\n") | |
| 18 | end | |
| 19 | ||
| 20 | Given(/^us er logs in with vali d credenti als to JLV $/) do | |
| 21 | ||
| 22 | Selenium_c ommand.nav igate_to_u rl("https: // IP /jlv/") | |
| 23 | ||
| 24 | Selenium _command.c lick_eleme nt('id', ' accept') | |
| 25 | # click_ element('i d', 'btnLo gon') | |
| 26 | # elemen t = Seleni um_command .drive @@w eb_driver. find_eleme nt(:id, 'b tnLogon') | |
| 27 | element = Selenium _command.d river.find _element(: id, 'btnLo gon') | |
| 28 | ||
| 29 | value_ma p = Hash.n ew | |
| 30 | field = "PatientSe arch" | |
| 31 | value_ma p["Patient Search"] = { :functi on=>"wait" , :searchO n=>"id", : locator=>" ext-gen135 " } | |
| 32 | method = value_map [field][:s earchOn] | |
| 33 | locator = value_ma p[field][: locator] | |
| 34 | ||
| 35 | element. click | |
| 36 | Selenium _command.s elect_fram e('index', '2') | |
| 37 | @start_t ime = Time .now | |
| 38 | Selenium _command.w ait_until_ element_pr esent(meth od, locato r) | |
| 39 | # select _frame_wai t('index', '2', meth od, locato r) | |
| 40 | @end_tim e = Time.n ow | |
| 41 | ||
| 42 | end | |
| 43 | ||
| 44 | When(/^a u ser search for patie nt with id $/) do |ta ble| | |
| 45 | paramete rs_class = Acc_Param eters.new | |
| 46 | Selenium _command.s elect_fram e('index', '2') | |
| 47 | action_m ap = param eters_clas s.Acc()[0] | |
| 48 | ||
| 49 | table.ro ws.each do |field, v alue | | |
| 50 | elemen t_function = action_ map[field] [:function ] | |
| 51 | method = action_ map[field] [:searchOn ] | |
| 52 | locato r = action _map[field ][:locator ] | |
| 53 | ||
| 54 | perfor m_function (element_f unction, m ethod, loc ator, valu e) | |
| 55 | ||
| 56 | end #tab le | |
| 57 | value_ma p = Hash.n ew | |
| 58 | field = "SearchRes ult" | |
| 59 | value_ma p["SearchR esult"] = { :functio n=>"wait", :searchOn =>"id", :l ocator=>"p atientsear chpdws-lin k-name-ext -record-6" } | |
| 60 | method = value_map [field][:s earchOn] | |
| 61 | locator = value_ma p[field][: locator] | |
| 62 | ||
| 63 | @start_t ime = Time .now | |
| 64 | # common _driver.wa itForPageL oaded() | |
| 65 | Selenium _command.w ait_for_el ement_pres ent(method , locator) | |
| 66 | @end_tim e = Time.n ow | |
| 67 | end | |
| 68 | ||
| 69 | Then(/^cap ture respo nse time f or "(.*?)" $/) do |re sponse_tim e_desc| | |
| 70 | ||
| 71 | file_pat h = '/User s/zadehf/D esktop/tes t_run.txt' | |
| 72 | append_o utput_to_f ile(file_p ath, respo nse_time_d esc, @end_ time-@star t_time) | |
| 73 | ||
| 74 | end | |
| 75 | ||
| 76 | Given(/^a patient wi th id "(.* ?)" has no t been syn ced$/) do |patientId | | |
| 77 | base_url = ENV.keys. include?(' LEIPR_IP') ? 'https: //' + ENV[ 'LEIPR_IP' ] : 'https :// IP ' | |
| 78 | database_i p = ENV['D ATABASE_IP '] || ' IP ' | |
| 79 | database _port = EN V['DATABAS E_PORT'] | | '27017' | |
| 80 | auth = { : username = > " REDACTED ", :passwo rd => " REDACTED " } | |
| 81 | ||
| 82 | url_path = "/admin /clear-cac he?patient Id=#{patie ntId}" | |
| 83 | full_pat h = "#{bas e_url}#{ur l_path}" | |
| 84 | HTTParty .post(full _path, { : verify => false, :ba sic_auth = > auth }) | |
| 85 | end | |
| 86 | ||
| 87 | When(/^use r select t he patient that has expected " (.*?)" dat a as "(.*? )"$/) do | field, val ue| | |
| 88 | value_ma p = Hash.n ew | |
| 89 | select_f ield = "Se archResult " | |
| 90 | value_ma p["SearchR esult"] = { :functio n=>"wait", :searchOn =>"id", :l ocator=>"p atientsear chpdws-lin k-name-ext -record-6" } | |
| 91 | method = value_map [select_fi eld][:sear chOn] | |
| 92 | locator = value_ma p[select_f ield][:loc ator] | |
| 93 | ||
| 94 | Selenium _command.c lick_eleme nt(method, locator) | |
| 95 | ||
| 96 | @start_t ime = Time .now | |
| 97 | ||
| 98 | div_cont ainer = fi nd_element ('xpath', "//span[co ntains(str ing(), '#{ field}')]/ ancestor:: div[contai ns(@class, 'x-portle t')]") | |
| 99 | div_cont ainer_id = div_conta iner.attri bute("id") | |
| 100 | method = 'xpath' | |
| 101 | locator = "//div[@ id='#{div_ container_ id}']/desc endant::td [contains( string(), '#{value}' )]" | |
| 102 | # test = find_elem ent('xpath ', "//div[ @id='#{div _container _id}']/des cendant::t d[contains (string(), '#{value} ')]") | |
| 103 | ||
| 104 | Selenium _command.w ait_for_el ement_pres ent(method , locator) | |
| 105 | @end_tim e = Time.n ow | |
| 106 | ||
| 107 | end | |
| 108 | ||
| 109 | Given(/^a patient wi th id "(.* ?)" has be en synced$ /) do |pat ientId| | |
| 110 | ||
| 111 | base_url = ENV.keys. include?(' LEIPR_IP') ? 'https: //' + ENV[ 'LEIPR_IP' ] : 'https :// IP ' | |
| 112 | database_i p = ENV['D ATABASE_IP '] || ' IP ' | |
| 113 | database _port = EN V['DATABAS E_PORT'] | | '27017' | |
| 114 | auth = { : username = > " REDACTED ", :passwo rd => " REDACTED " } | |
| 115 | ||
| 116 | short_pa th = "/pat ient-resou rce-direct ory?patien tId=#{pati entId}" | |
| 117 | patient_ resource_d irectory_p ath = "#{b ase_url}#{ short_path }" | |
| 118 | ||
| 119 | director y = HTTPar ty.get(pat ient_resou rce_direct ory_path, { :verify => false, :basic_aut h => auth }) | |
| 120 | director y_json = J SON.parse( directory. body) | |
| 121 | link_arr ay = direc tory_json[ 0]["link"] | |
| 122 | expect(l ink_array. is_a?(Arra y)).to be_ true | |
| 123 | vital_li nk = link_ array.find { |array| array["ti tle"] == " vital" } | |
| 124 | vital_pa th = vital _link["hre f"] | |
| 125 | # puts " fetch vita ls from " + vital_pa th | |
| 126 | #--farid -s | |
| 127 | @respons e = HTTPar ty.get(vit al_path, { :verify = > false, : headers => { 'Accept ' => 'appl ication/js on' }, :ba sic_auth = > auth }) | |
| 128 | response _http_stat us_code = @response. code | |
| 129 | patient_ synced = f alse | |
| 130 | #sleep(4 ) | |
| 131 | wait_tim e = "2" | |
| 132 | time_out = "60" | |
| 133 | http_sta tus_code = 200 | |
| 134 | for i i n 0..Integ er(time_ou t)/Integer (wait_time ) | |
| 135 | if res ponse_http _status_co de != http _status_co de | |
| 136 | slee p(Integer( wait_time) ) | |
| 137 | @res ponse = HT TParty.get (vital_pat h, { :veri fy => fals e, :header s => { 'Ac cept' => ' applicatio n/json' }, :basic_au th => auth }) | |
| 138 | resp onse_http_ status_cod e = @respo nse.code | |
| 139 | else | |
| 140 | pati ent_synced = true | |
| 141 | brea k | |
| 142 | end | |
| 143 | end | |
| 144 | ||
| 145 | if patie nt_synced == false | |
| 146 | puts " Timeout er ror! a pat ient has n ot been sy nced withi n "+time_o ut+ " seco nds." | |
| 147 | end | |
| 148 | expect(p atient_syn ced).to be _true | |
| 149 | end | |
| 150 | ||
| 151 | Given(/^us er log out $/) do | |
| 152 | Selenium _command.c lick_eleme nt('id', ' ext-gen190 ') | |
| 153 | end |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.