Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A simple gem that assists in creating flexible page objects for testing browser based applications. The goal is to facilitate creating abstraction layers in your tests to decouple the tests from the item they are testing and to provide a simple interface to the elements on a page. It works with both watir and selenium-webdriver.
The project wiki is the first place to go to learn about how to use page-object.
The rdocs for this project can be found at rubydoc.info.
To see the changes from release to release please look at the ChangeLog
To read about the motivation for this gem please read this blog entry
There is a book that describes in detail how to use this gem and others to create a complete view of testing web and other types of applications. The book is named Cucumber & Cheese
If you need help using the page-object gem please ask your questions on Stack Overflow. Please be sure to use the page-object-gem tag. If you wish to report an issue or request a new feature use the github issue tracking page.
You define a new page object by including the PageObject module:
class LoginPage
include PageObject
end
When you include this module numerous methods are added to your class that allow you to easily define your page. For the login page you might add the following:
class LoginPage
include PageObject
text_field(:username, :id => 'username')
text_field(:password, :id => 'password')
button(:login, :id => 'login')
end
Calling the text_field and button methods adds several methods to our page object that allow us to interact with the items on the page. To login using this page we could simply write the following code:
login_page.username = 'cheezy'
login_page.password = 'secret'
login_page.login
Another approach might be to create higher level methods on our page object that hide the implementation details even further. Our page object might look like this:
class LoginPage
include PageObject
text_field(:username, :id => 'username')
text_field(:password, :id => 'password')
button(:login, :id => 'login')
def login_with(username, password)
self.username = username
self.password = password
login
end
end
and your usage of the page would become:
login_page.login_with 'cheezy', 'secret'
page-object supports both watir and selenium-webdriver. The one used will be determined by which driver you pass into the constructor of your page object. The page object can be created like this:
browser = Watir::Browser.new :firefox
my_page_object = MyPageObject.new(browser)
or
browser = Selenium::WebDriver.for :firefox
my_page_object = MyPageObject.new(browser)
See http://github.com/cheezy/page-object/issues
Copyright (c) 2011-2012 Jeffrey S. Morgan. See LICENSE for details.
FAQs
Unknown package
We found that centric_page_object demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.