Ifd_Automation 2.9 → 2.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Ifd_Automation/REST_steps.rb +33 -33
- data/lib/Ifd_Automation/SOAP_steps.rb +31 -31
- data/lib/Ifd_Automation/assertion_helper.rb +97 -0
- data/lib/Ifd_Automation/auto_util.rb +161 -0
- data/lib/Ifd_Automation/database_helper.rb +78 -0
- data/lib/Ifd_Automation/database_steps.rb +44 -44
- data/lib/Ifd_Automation/dynamic_store_value_steps.rb +18 -18
- data/lib/Ifd_Automation/email_steps.rb +31 -31
- data/lib/Ifd_Automation/file_helper.rb +33 -0
- data/lib/Ifd_Automation/file_steps.rb +9 -9
- data/lib/Ifd_Automation/mail_helper.rb +56 -0
- data/lib/Ifd_Automation/require_libs.rb +9 -9
- data/lib/Ifd_Automation/rest_helper.rb +89 -0
- data/lib/Ifd_Automation/soap_helper.rb +57 -0
- data/lib/Ifd_Automation/ssh_helper.rb +37 -0
- data/lib/Ifd_Automation/ssh_steps.rb +15 -15
- data/lib/{helper → Ifd_Automation}/step_fallback.rb +0 -0
- data/lib/{helper → Ifd_Automation}/tolerance_for_selenium_sync_issues.rb +0 -0
- data/lib/Ifd_Automation/version.rb +1 -1
- data/lib/{helper → Ifd_Automation}/web_steps_helper.rb +419 -40
- data/project/Gemfile +1 -1
- data/project/features/TestSuite/WebGUI.feature +4 -4
- data/project/features/step_definitions/lib_steps/steps_definition.rb +4 -2
- data/project/features/step_definitions/repositories/project_object.yml +2 -1
- metadata +13 -13
- data/lib/helper/assertion_helper.rb +0 -100
- data/lib/helper/auto_util.rb +0 -164
- data/lib/helper/database_helper.rb +0 -81
- data/lib/helper/file_helper.rb +0 -36
- data/lib/helper/mail_helper.rb +0 -58
- data/lib/helper/rest_helper.rb +0 -91
- data/lib/helper/soap_helper.rb +0 -59
- data/lib/helper/ssh_helper.rb +0 -39
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'net/https'
|
2
2
|
require 'rspec'
|
3
|
+
require_relative '../Ifd_Automation/assertion_helper.rb'
|
4
|
+
|
3
5
|
def execute_openbrowser(url_site)
|
4
6
|
begin
|
5
7
|
if $_CFWEB['Maximize Browser'] == true
|
@@ -280,7 +282,7 @@ end
|
|
280
282
|
|
281
283
|
def switch_to_frame(element)
|
282
284
|
begin
|
283
|
-
page.driver.browser.switch_to.frame
|
285
|
+
page.driver.browser.switch_to.frame element
|
284
286
|
rescue Exception => e
|
285
287
|
raise "\n>>> Error: #{e}"
|
286
288
|
exit
|
@@ -487,11 +489,11 @@ def validate_supported_keys(key)
|
|
487
489
|
raise "Please select valid keys, invalid key - #{key}" unless check_valid_option_by? key
|
488
490
|
end
|
489
491
|
|
490
|
-
|
491
|
-
def find_object(string_object)
|
492
|
+
def find_object string_object
|
492
493
|
startTime = Time.new.to_i
|
493
494
|
string_object = string_object.gsub(/"/, "'")
|
494
495
|
locator_matching = /(.*?)(\{.*?\})/.match(string_object)
|
496
|
+
p "locator_matching:#{locator_matching}"
|
495
497
|
dyn_pros = {}
|
496
498
|
if locator_matching != nil
|
497
499
|
string_object = locator_matching[1]
|
@@ -499,15 +501,15 @@ def find_object(string_object)
|
|
499
501
|
dyn_pros[k.to_s.upcase] = v
|
500
502
|
}
|
501
503
|
end
|
502
|
-
|
503
504
|
hash_object = $OBJECT[string_object]
|
504
505
|
if hash_object == nil
|
505
506
|
raise "ERROR: >>> Object: #{string_object} is not found in Object Repository."
|
506
507
|
end
|
507
508
|
upcase_attrb = {}
|
508
509
|
if hash_object != nil
|
509
|
-
hash_object.each {
|
510
|
+
hash_object.each {|k,v|
|
510
511
|
k = k.to_s.upcase
|
512
|
+
p "\n#{k} =~ /ph_/i and dyn_pros[#{k}]: #{k =~ /ph_/i and dyn_pros[k] != nil}"
|
511
513
|
if k =~ /ph_/i
|
512
514
|
if dyn_pros[k] != nil
|
513
515
|
if v =~ /<ph_value>/i
|
@@ -515,72 +517,208 @@ def find_object(string_object)
|
|
515
517
|
else
|
516
518
|
upcase_attrb[k[3..k.size-1]] = dyn_pros[k]
|
517
519
|
end
|
518
|
-
|
519
520
|
dyn_pros.delete(k)
|
520
521
|
end
|
521
522
|
else
|
522
523
|
upcase_attrb[k.to_s.upcase] = v
|
523
524
|
end
|
524
|
-
|
525
525
|
}
|
526
526
|
end
|
527
527
|
ph_attrs = {}
|
528
|
-
dyn_pros.each
|
528
|
+
dyn_pros.each{|k,v|
|
529
529
|
if k =~ /ph_/i
|
530
530
|
ph_attrs[k] = v
|
531
531
|
else
|
532
532
|
upcase_attrb[k.to_s.upcase] = v
|
533
533
|
end
|
534
534
|
}
|
535
|
-
|
536
535
|
if upcase_attrb.size > 0
|
536
|
+
strId = ""
|
537
|
+
strClass = ""
|
538
|
+
strName = ""
|
539
|
+
strTagname = ""
|
537
540
|
strCssSelector = ""
|
538
541
|
strXpathSelector = ""
|
542
|
+
strText = ""
|
543
|
+
strRelated = ""
|
544
|
+
strRelatedType = ""
|
545
|
+
|
546
|
+
index = nil
|
547
|
+
minWidth = -1
|
548
|
+
maxWidth = -1
|
549
|
+
minHeight = -1
|
550
|
+
maxHeight = -1
|
539
551
|
|
552
|
+
ano_pros = {}
|
540
553
|
|
541
|
-
upcase_attrb.each
|
554
|
+
upcase_attrb.each{|key, value|
|
542
555
|
upcase_key = key.to_s.upcase
|
543
556
|
case upcase_key
|
544
557
|
when "XPATH_SELECTOR"
|
545
558
|
strXpathSelector = value
|
546
559
|
when "CSS_SELECTOR"
|
547
560
|
strCssSelector = value
|
561
|
+
when "ID"
|
562
|
+
strId = value
|
563
|
+
when "CLASS"
|
564
|
+
strClass = value
|
565
|
+
when "NAME"
|
566
|
+
strName = value
|
567
|
+
when "TAGNAME"
|
568
|
+
strTagname = value
|
569
|
+
when "TEXT"
|
570
|
+
strText = value
|
571
|
+
when "INDEX"
|
572
|
+
index = value
|
548
573
|
else
|
549
|
-
raise "ERROR: >>> Wrong format type: #{key.to_s} of object: #{string_object}. Available supported format are: XPATH_SELECTOR
|
574
|
+
raise "ERROR: >>> Wrong format type: #{key.to_s} of object: #{string_object}. Available supported format are: XPATH_SELECTOR | CSS_SELECTOR | ID | NAME | CLASS | TEXT | TAGNAME | INDEX"
|
550
575
|
end
|
551
576
|
}
|
577
|
+
continue_run = true;
|
578
|
+
ref_object = nil;
|
552
579
|
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
foundElements = get_objects_by_xpath_selector(strXpathSelector)
|
580
|
+
if strRelated != nil and strRelated.length > 0
|
581
|
+
ref_object = find_object(strRelated)
|
582
|
+
if (ref_object == nil)
|
583
|
+
continue_run = false
|
558
584
|
end
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
585
|
+
end
|
586
|
+
|
587
|
+
if continue_run == true
|
588
|
+
begin
|
589
|
+
if strCssSelector != nil and strCssSelector.length > 0
|
590
|
+
foundElements = get_objects_by_css_selector(strCssSelector)
|
591
|
+
elsif strXpathSelector != nil and strXpathSelector.length > 0
|
592
|
+
foundElements = get_objects_by_xpath_selector(strXpathSelector)
|
593
|
+
else
|
594
|
+
strGenerateXpathSel = generate_xpath_selector(strId, strClass, strName, strTagname)
|
595
|
+
if strGenerateXpathSel.length > 0
|
596
|
+
foundElements = get_objects_by_xpath_selector(strGenerateXpathSel)
|
597
|
+
else
|
598
|
+
if (check_string_letters_only(strId))
|
599
|
+
foundElements = get_objects_by_Id(strId)
|
600
|
+
elsif (check_string_letters_only(strName))
|
601
|
+
foundElements = get_objects_by_Name(strName)
|
602
|
+
elsif (check_string_letters_only(strClass))
|
603
|
+
foundElements = get_objects_by_Class(strClass)
|
604
|
+
elsif (check_string_letters_only(strTagname))
|
605
|
+
foundElements = get_objects_by_Tagname(strTagname)
|
606
|
+
end
|
607
|
+
end
|
608
|
+
end
|
609
|
+
if foundElements == nil or foundElements.length == 0
|
610
|
+
currentTime = Time.new.to_i
|
611
|
+
else
|
576
612
|
break
|
577
613
|
end
|
578
|
-
|
579
|
-
|
614
|
+
sleep(0.5)
|
615
|
+
end while (currentTime - startTime) < $_CFWEB['Wait Time']
|
616
|
+
|
617
|
+
if foundElements != nil or foundElements.length != 0
|
618
|
+
if index != nil and index.to_i >= 0
|
619
|
+
matched_index = 0;
|
620
|
+
return_element = nil
|
621
|
+
foundElements.each{|cur_element|
|
622
|
+
passCheck = find_object_check_object(cur_element, ref_object, strRelatedType, strId, strClass, strName, strTagname, strText, minWidth, maxWidth, minHeight, maxHeight, ano_pros)
|
623
|
+
if passCheck
|
624
|
+
if matched_index == index.to_i
|
625
|
+
return_element = cur_element
|
626
|
+
break
|
627
|
+
else
|
628
|
+
matched_index = matched_index + 1
|
629
|
+
end
|
630
|
+
end
|
631
|
+
}
|
632
|
+
return return_element
|
633
|
+
else
|
634
|
+
return_element = nil
|
635
|
+
foundElements.each{|cur_element|
|
636
|
+
passCheck = find_object_check_object(cur_element, ref_object, strRelatedType, strId, strClass, strName, strTagname, strText, minWidth, maxWidth, minHeight, maxHeight, ano_pros)
|
637
|
+
if passCheck
|
638
|
+
return_element = cur_element
|
639
|
+
break
|
640
|
+
end
|
641
|
+
}
|
642
|
+
return return_element
|
643
|
+
end # if index != nil and index.to_i >= 0
|
644
|
+
end #if foundElements != nil or foundElements.length != 0
|
645
|
+
end #if continue = true
|
646
|
+
end
|
647
|
+
return nil
|
648
|
+
end
|
649
|
+
|
650
|
+
def generate_xpath_selector(strId, strClass, strName, strTagname)
|
651
|
+
strGenerateXpathSel = ""
|
652
|
+
if strId != nil and strId.length > 0 and (strId =~ /^#/) == nil
|
653
|
+
strGenerateXpathSel = "[@id='#{strId}']"
|
654
|
+
end
|
655
|
+
if strClass != nil and strClass.length > 0 and (strClass =~ /^#/) == nil
|
656
|
+
strGenerateXpathSel = "#{strGenerateXpathSel}[@class='#{strClass}']"
|
657
|
+
end
|
658
|
+
if strName != nil and strName.length > 0 and (strName =~ /^#/) == nil
|
659
|
+
strGenerateXpathSel = "#{strGenerateXpathSel}[@name='#{strName}']"
|
660
|
+
end
|
661
|
+
|
662
|
+
if strGenerateXpathSel.length > 0
|
663
|
+
if strTagname != nil and strTagname.length > 0
|
664
|
+
strGenerateXpathSel = "//#{strTagname}#{strGenerateXpathSel}"
|
665
|
+
else
|
666
|
+
strGenerateXpathSel = "//*#{strGenerateXpathSel}"
|
580
667
|
end
|
581
668
|
end
|
582
669
|
|
583
|
-
|
670
|
+
return strGenerateXpathSel
|
671
|
+
end
|
672
|
+
|
673
|
+
def check_string_letters_only(strToCheck)
|
674
|
+
if strToCheck != nil and strToCheck.length > 0 and strToCheck =~ /^[a-zA-Z]+$/
|
675
|
+
return true
|
676
|
+
end
|
677
|
+
return false
|
678
|
+
end
|
679
|
+
|
680
|
+
def get_objects_by_Id(strId)
|
681
|
+
foundElements = nil
|
682
|
+
begin
|
683
|
+
foundElements = page.all("*[@id='#{strId}']")
|
684
|
+
rescue StandardError => e
|
685
|
+
raise "\n>>> Error: #{e}"
|
686
|
+
end
|
687
|
+
|
688
|
+
return foundElements
|
689
|
+
end
|
690
|
+
|
691
|
+
def get_objects_by_Class(strClass)
|
692
|
+
foundElements = nil
|
693
|
+
begin
|
694
|
+
foundElements = page.all("*[@class='#{strClass}']")
|
695
|
+
rescue StandardError => e
|
696
|
+
raise "\n>>> Error: #{e}"
|
697
|
+
end
|
698
|
+
|
699
|
+
return foundElements
|
700
|
+
end
|
701
|
+
|
702
|
+
def get_objects_by_Name(strName)
|
703
|
+
foundElements = nil
|
704
|
+
begin
|
705
|
+
foundElements = page.all("*[@name='#{strName}']")
|
706
|
+
rescue StandardError => e
|
707
|
+
raise "\n>>> Error: #{e}"
|
708
|
+
end
|
709
|
+
|
710
|
+
return foundElements
|
711
|
+
end
|
712
|
+
|
713
|
+
def get_objects_by_Tagname(strTagname)
|
714
|
+
foundElements = nil
|
715
|
+
begin
|
716
|
+
foundElements = page.all("#{strTagname}")
|
717
|
+
rescue StandardError => e
|
718
|
+
raise "\n>>> Error: #{e}"
|
719
|
+
end
|
720
|
+
|
721
|
+
return foundElements
|
584
722
|
end
|
585
723
|
|
586
724
|
def get_objects_by_css_selector(strCssSelector)
|
@@ -599,23 +737,264 @@ def get_objects_by_xpath_selector(strXpathSelector)
|
|
599
737
|
foundElements = page.all(:xpath, strXpathSelector)
|
600
738
|
rescue StandardError => e
|
601
739
|
raise "\n>>> Error: #{e}"
|
602
|
-
exit
|
603
740
|
end
|
604
741
|
foundElements
|
605
742
|
end
|
606
743
|
|
607
|
-
def find_object_check_object(cur_element)
|
744
|
+
def find_object_check_object(cur_element, ref_object, ref_object_type, strId, strClass, strName, strTagname, strText, minWidth, maxWidth, minHeight, maxHeight, ano_pros)
|
608
745
|
passCheck = true
|
609
746
|
if cur_element != nil
|
747
|
+
# Check ref_object
|
748
|
+
if (ref_object != nil)
|
749
|
+
if find_object_check_ref_object(ref_object, ref_object_type, cur_element) == false
|
750
|
+
passCheck = false
|
751
|
+
end
|
752
|
+
end
|
753
|
+
|
754
|
+
# Check ID
|
755
|
+
if strId != nil and strId.length > 0
|
756
|
+
if strId =~ /^#/
|
757
|
+
strId = strId[1..-1]
|
758
|
+
end
|
759
|
+
if find_object_check_Id(cur_element, strId) == false
|
760
|
+
passCheck = false
|
761
|
+
end
|
762
|
+
end
|
763
|
+
|
764
|
+
# Check Class
|
765
|
+
if passCheck and strClass != nil and strClass.length > 0
|
766
|
+
if strClass =~ /^#/
|
767
|
+
strClass = strClass[1..-1]
|
768
|
+
end
|
769
|
+
if find_object_check_Class(cur_element, strClass) == false
|
770
|
+
passCheck = false
|
771
|
+
end
|
772
|
+
end
|
773
|
+
|
774
|
+
# Check Name
|
775
|
+
if passCheck and strName != nil and strName.length > 0
|
776
|
+
if strName =~ /^#/
|
777
|
+
strName = strName[1..-1]
|
778
|
+
end
|
779
|
+
if find_object_check_Name(cur_element, strName) == false
|
780
|
+
passCheck = false
|
781
|
+
end
|
782
|
+
end
|
783
|
+
|
784
|
+
# Check Tag name
|
785
|
+
if passCheck and strTagname != nil and strTagname.length > 0
|
786
|
+
if find_object_check_Tagname(cur_element, strTagname) == false
|
787
|
+
passCheck = false
|
788
|
+
end
|
789
|
+
end
|
790
|
+
|
791
|
+
# Check Text
|
792
|
+
if passCheck and strText != nil and strText.length > 0
|
793
|
+
if (strText =~ /^#/)
|
794
|
+
strText = strText[1..-1]
|
795
|
+
end
|
796
|
+
|
797
|
+
if find_object_check_Text(cur_element, strText) == false
|
798
|
+
passCheck = false
|
799
|
+
end
|
800
|
+
end
|
801
|
+
|
802
|
+
# Check minWidth
|
803
|
+
if passCheck and minWidth > 0
|
804
|
+
if !find_object_check_minWidth(cur_element, minWidth)
|
805
|
+
passCheck = false
|
806
|
+
end
|
807
|
+
end
|
808
|
+
|
809
|
+
# Check maxWidth
|
810
|
+
if passCheck and maxWidth > 0
|
811
|
+
if !find_object_check_maxWidth(cur_element, maxWidth)
|
812
|
+
passCheck = false
|
813
|
+
end
|
814
|
+
end
|
815
|
+
|
816
|
+
# Check minHeight
|
817
|
+
if passCheck and minHeight > 0
|
818
|
+
if !find_object_check_minHeight(cur_element, minHeight)
|
819
|
+
passCheck = false
|
820
|
+
end
|
821
|
+
end
|
822
|
+
|
823
|
+
# Check maxHeight
|
824
|
+
if passCheck and maxHeight > 0
|
825
|
+
if !find_object_check_maxHeight(cur_element, maxHeight)
|
826
|
+
passCheck = false
|
827
|
+
end
|
828
|
+
end
|
829
|
+
|
830
|
+
# Check another properties
|
831
|
+
if passCheck and ano_pros.length > 0
|
832
|
+
ano_pros.each{|property, value|
|
833
|
+
if value =~ /^#/
|
834
|
+
value = value[1..-1]
|
835
|
+
end
|
836
|
+
if !find_object_check_property(cur_element, property, value)
|
837
|
+
passCheck = false
|
838
|
+
break
|
839
|
+
end
|
840
|
+
}
|
841
|
+
end
|
842
|
+
|
610
843
|
return passCheck
|
611
844
|
end
|
612
|
-
|
845
|
+
|
846
|
+
return false
|
847
|
+
end
|
848
|
+
|
849
|
+
def find_object_check_Id(element, strId)
|
850
|
+
actual_Id = element[:id]
|
851
|
+
if actual_Id != nil and actual_Id.length > 0
|
852
|
+
actual_Id = actual_Id.strip
|
853
|
+
if reg_compare(actual_Id, strId)
|
854
|
+
return true
|
855
|
+
end
|
856
|
+
end
|
857
|
+
|
858
|
+
return false
|
859
|
+
end
|
860
|
+
def find_object_check_Class(element, strClass)
|
861
|
+
actual_Class = element[:class]
|
862
|
+
if actual_Class != nil and actual_Class.length > 0
|
863
|
+
actual_Class = actual_Class.strip
|
864
|
+
if reg_compare(actual_Class, strClass)
|
865
|
+
return true
|
866
|
+
end
|
867
|
+
end
|
868
|
+
|
869
|
+
return false
|
870
|
+
end
|
871
|
+
def find_object_check_Name(element, strName)
|
872
|
+
actual_Name = element[:name]
|
873
|
+
if actual_Name != nil and actual_Name.length > 0
|
874
|
+
actual_Name = actual_Name.strip
|
875
|
+
if reg_compare(actual_Name, strName)
|
876
|
+
return true
|
877
|
+
end
|
878
|
+
end
|
879
|
+
|
880
|
+
return false
|
881
|
+
end
|
882
|
+
|
883
|
+
def find_object_check_Tagname(element, strTagname)
|
884
|
+
actual_Tagname = element.tag_name()
|
885
|
+
if actual_Tagname != nil and actual_Tagname.length > 0
|
886
|
+
actual_Tagname = actual_Tagname.strip
|
887
|
+
if reg_compare(actual_Tagname, strTagname)
|
888
|
+
return true
|
889
|
+
end
|
890
|
+
end
|
891
|
+
|
892
|
+
return false
|
893
|
+
end
|
894
|
+
def find_object_check_Xpath(element, strXpath)
|
895
|
+
|
896
|
+
end
|
897
|
+
def find_object_check_Text(element, strText)
|
898
|
+
actual_Text = element.text()
|
899
|
+
if actual_Text != nil and actual_Text.length > 0
|
900
|
+
actual_Text = actual_Text.strip
|
901
|
+
if reg_compare(actual_Text, strText)
|
902
|
+
return true
|
903
|
+
end
|
904
|
+
end
|
905
|
+
|
906
|
+
return false
|
907
|
+
end
|
908
|
+
def find_object_check_minWidth(element, minWidth)
|
909
|
+
width = element[:width]
|
910
|
+
if (width >= minWidth)
|
911
|
+
return true
|
912
|
+
end
|
913
|
+
|
914
|
+
return false
|
915
|
+
end
|
916
|
+
def find_object_check_maxWidth(element, maxWidth)
|
917
|
+
width = element[:width]
|
918
|
+
if (width <= maxWidth)
|
919
|
+
return true
|
920
|
+
end
|
921
|
+
|
922
|
+
return false
|
923
|
+
end
|
924
|
+
def find_object_check_minHeight(element, minHeight)
|
925
|
+
height = element[:height]
|
926
|
+
if (height <= minHeight)
|
927
|
+
return true
|
928
|
+
end
|
929
|
+
|
930
|
+
return false
|
931
|
+
end
|
932
|
+
def find_object_check_maxHeight(element, maxHeight)
|
933
|
+
height = element[:height]
|
934
|
+
if (height <= maxHeight)
|
935
|
+
return true
|
936
|
+
end
|
937
|
+
|
938
|
+
return false
|
939
|
+
end
|
940
|
+
|
941
|
+
def find_object_check_ref_object(ref_object, ref_type, target_element)
|
942
|
+
begin
|
943
|
+
ref = ref_object.native
|
944
|
+
target = target_element.native
|
945
|
+
if(ref_type == "up" or ref_type == "down")
|
946
|
+
ref_x1 = ref.location.x - 10
|
947
|
+
ref_x2 = ref.location.x + ref.size.width + 10
|
948
|
+
target_x1 = target.location.x
|
949
|
+
target_x2 = target_x1 + target.size.width
|
950
|
+
elsif(ref_type == "left" or ref_type == "right")
|
951
|
+
ref_y1 = ref.location.y - 10
|
952
|
+
ref_y2 = ref.location.y + ref_object.native.size.height + 10
|
953
|
+
target_y1 = target.location.y
|
954
|
+
target_y2 = target_y1 + target.size.height
|
955
|
+
elsif(ref_type == "child" or ref_type == "parent")
|
956
|
+
ref_W = ref.location.x + ref.size.width
|
957
|
+
ref_H = ref.location.y + ref.size.height
|
958
|
+
target_W = target.location.x + target.size.width
|
959
|
+
target_H = target.location.y + target.size.height
|
960
|
+
end
|
961
|
+
|
962
|
+
if(ref_type == "up" and
|
963
|
+
target_x1 > ref_x1 and target_x2 < ref_x2 and # has same column or X Position
|
964
|
+
target.location.y < ref.location.y) # at row or Y position, target is upper
|
965
|
+
return true
|
966
|
+
elsif(ref_type == "down" and
|
967
|
+
target_x1 > ref_x1 and target_x2 < ref_x2 and # has same column or X Position
|
968
|
+
target.location.y > ref.location.y) # at row or Y position, target is at down
|
969
|
+
return true
|
970
|
+
elsif(ref_type == "left" and
|
971
|
+
target.location.x < ref.location.x and # at column or X Position, target is at left
|
972
|
+
target_y1 > ref_y1 and target_y2 < ref_y2) # at row or Y position, target is same as ref object
|
973
|
+
return true
|
974
|
+
elsif(ref_type == "right" and
|
975
|
+
target.location.x > ref.location.x and # at column or X Position, target is at right
|
976
|
+
target_y1 > ref_y1 and target_y2 < ref_y2) # at row or Y position, target is same as ref object
|
977
|
+
return true
|
978
|
+
elsif(ref_type == "child" and
|
979
|
+
(target_W < ref_W) and (target_H < ref_H) and
|
980
|
+
(target.location.x > ref.location.x) and (target.location.y > ref.location.y))
|
981
|
+
return true
|
982
|
+
elsif(ref_type == "parent" and
|
983
|
+
(target_W > ref_W) and (target_H > ref_H) and
|
984
|
+
(target.location.x < ref.location.x) and (target.location.y < ref.location.y))
|
985
|
+
return true
|
986
|
+
end
|
987
|
+
rescue StandardError => e
|
988
|
+
raise "\n>>> Error: #{e}"
|
989
|
+
end
|
990
|
+
|
991
|
+
return false;
|
613
992
|
end
|
614
993
|
|
615
994
|
def get_object_and_store_as_string(object,string)
|
616
995
|
text = execute_gettext(object)
|
617
996
|
txt = "'" + text + "'"
|
618
|
-
|
997
|
+
set_var(string, txt)
|
619
998
|
end
|
620
999
|
|
621
1000
|
|
data/project/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
|
-
gem 'Ifd_Automation'
|
2
|
+
# gem 'Ifd_Automation'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
Feature:
|
2
|
-
|
3
|
-
Scenario:
|
4
|
-
Given I open the homepage
|
1
|
+
Feature: test
|
2
|
+
@test
|
3
|
+
Scenario: test
|
4
|
+
Given I open the homepage
|
@@ -1 +1,2 @@
|
|
1
|
-
test: {
|
1
|
+
test: {tagname: 'a', name: 'banner-button'}
|
2
|
+
test1: {tagname: 'li', class: 'list-inline-item', index: 5}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Ifd_Automation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anh Pham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|
@@ -267,25 +267,25 @@ files:
|
|
267
267
|
- lib/Ifd_Automation/REST_steps.rb
|
268
268
|
- lib/Ifd_Automation/SOAP_steps.rb
|
269
269
|
- lib/Ifd_Automation/all_steps.rb
|
270
|
+
- lib/Ifd_Automation/assertion_helper.rb
|
271
|
+
- lib/Ifd_Automation/auto_util.rb
|
272
|
+
- lib/Ifd_Automation/database_helper.rb
|
270
273
|
- lib/Ifd_Automation/database_steps.rb
|
271
274
|
- lib/Ifd_Automation/dynamic_store_value_steps.rb
|
272
275
|
- lib/Ifd_Automation/email_steps.rb
|
276
|
+
- lib/Ifd_Automation/file_helper.rb
|
273
277
|
- lib/Ifd_Automation/file_steps.rb
|
278
|
+
- lib/Ifd_Automation/mail_helper.rb
|
274
279
|
- lib/Ifd_Automation/require_libs.rb
|
280
|
+
- lib/Ifd_Automation/rest_helper.rb
|
281
|
+
- lib/Ifd_Automation/soap_helper.rb
|
282
|
+
- lib/Ifd_Automation/ssh_helper.rb
|
275
283
|
- lib/Ifd_Automation/ssh_steps.rb
|
284
|
+
- lib/Ifd_Automation/step_fallback.rb
|
285
|
+
- lib/Ifd_Automation/tolerance_for_selenium_sync_issues.rb
|
276
286
|
- lib/Ifd_Automation/version.rb
|
277
287
|
- lib/Ifd_Automation/web_steps.rb
|
278
|
-
- lib/
|
279
|
-
- lib/helper/auto_util.rb
|
280
|
-
- lib/helper/database_helper.rb
|
281
|
-
- lib/helper/file_helper.rb
|
282
|
-
- lib/helper/mail_helper.rb
|
283
|
-
- lib/helper/rest_helper.rb
|
284
|
-
- lib/helper/soap_helper.rb
|
285
|
-
- lib/helper/ssh_helper.rb
|
286
|
-
- lib/helper/step_fallback.rb
|
287
|
-
- lib/helper/tolerance_for_selenium_sync_issues.rb
|
288
|
-
- lib/helper/web_steps_helper.rb
|
288
|
+
- lib/Ifd_Automation/web_steps_helper.rb
|
289
289
|
- project/Gemfile
|
290
290
|
- project/README.md
|
291
291
|
- project/cucumber.yml
|