AutomationObject Ruby Gem for UI Automation Published
6803 단어 automation우이YAML루비Git
Gem Purpose:
The purpose of this gem was to provide a layer in between the drivers I commonly used and my Cucumber testing suite. Using YAML configurations to define and map the UI, this gem enables the creation of a dynamic DSL framework reflecting the configuration that allows automation occur through the provided DSL API.
Reason for Creating:
Working as a QA developer in Test, I was having a hard time figuring out how I could scale up our testing codebase. I had an idea which included using configurations to define UI automation behavior and combine that with Ruby's super sweet meta programming ( abilities to create a dynamic DSL framework that controls the UI automation. Using the DSL framework which represented the UI I wanted to automate, I could issue commands to the framework and keep the complexities of UI automation hidden from the rest of the codebase.
The hope was that the codebase growth would be limited to the YAML configurations and cucumber features, and nowhere else. With the proper organization of the YAML configuration files, I could continue to grow those configurations and have legacy versions stored too. Using state , I wouldn't have continual growth in that part of the codebase. Then finally, cucumber features that would test specific sites that can write my essay online or apps using specific YAML configurations would be the only other part to grow.
Example YAML Configuration File:
qiita.rb
base_url: 'http://www.spartzinc.com'
default_screen: 'home_screen'
screens:
home_screen:
elements:
team_link:
css: '#path div.to #element'
click:
after:
change_screen: 'team_screen'
team_screen:
before_load:
wait_for_elements:
- element_name: 'title'
exists?: true
visible?: true
text: 'Meet Our Team'
elements:
title:
xpath: '//path/to/element'
Example Ruby File:
qiita.rb
require 'automation_object'
require 'selenium-webdriver'
#New Selenium Driver
driver = Selenium::WebDriver.for :chrome
#Will load split up YAML files and return them merged into one Hash object
blue_prints = AutomationObject::BluePrint.new('/file/path/containing/yaml/files')
#Create the DSL framework
automation_object = AutomationObject::Framework.new(driver, blue_prints)
#Now lets automate, default screen is home_screen
automation_object.home_screen.team_link.click
#Framework has already executed the waiting hooks in the config above
#Now lets print out the team screen title
puts automation_object.team_screen.title.text
Fair Warning:
This is the initial release of this gem, kind of a proof of concept. There is a lot of coupling and very long methods that make this gem less appealing, but it is stable. Although we do use this at our company for all of our UI testing and we have a very stable and scalable testing codebase.
Future Plans:
I plan on creating a new class/object structure, unit testing, internal documentation to support further growth of this gem by the end of Q1 2015. Also considering adding Cucumber step definitions for your use that will implement the AutomationObject framework so that testing will be plug and play, only needing features and configurations from you.
Finally:
I am very grateful that my managers at Spartz allowed me to pursue this idea, even though I had no idea how this would be implemented. The idea ended up working out for us and I hope you may get some use out of it too.
Installation Instructions:
htps : // 기주 b. 코 m / s 파 rt 진 c / 오토 마치 온 _ 오 b ぇ ct # 엔 s 타치 치온
Source Code:
htps : // 기주 b. 코 m / s 파 rt 진 c / 오토 마치온 _ 오 b 지 ct
Examples:
htps : // 기주 b. 이 m/s파rt진c/아우토마치온_오 b지ぇct/bぉb/마s r/도cs/레아D메. md#에아mpぇs
RubyGems:
htps : / / 루 바이 게 ms. 오 rg / 게 ms / 오토 마치온 _ 오 b ぇ ct
Reference
이 문제에 관하여(AutomationObject Ruby Gem for UI Automation Published), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/olidunwall/items/cc6dadcfabdebd355a1a텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)