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
class ProjectName(unittest.TestCase): | |
def __init__(self, browser): | |
if browser == "firefox": | |
self.driver = webdriver.Firefox() | |
elif browser == "ie": | |
self.driver = webdriver.Ie() | |
elif browser == "chrome": | |
self.driver = webdriver.Chrome() | |
else: | |
print( "browsers: firefox, ie, chrome" ) |
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
require "watir" | |
require "json" | |
def sign_up(url, name, email, password) | |
print "watir will run the internet explorer" | |
browser = Watir::Browser.start url | |
browser.link(:xpath, "/html/body/div/div[2]/div/div/div[4]/a").click | |
browser.link(:id, "registrationLink").click | |
browser.text_field(:id, "ap_customer_name").set(name) | |
browser.text_field(:id, "ap_email").set(email) |
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
def new_member_form_check(self): | |
self.setUp() | |
driver = self.driver | |
m = TestData() | |
email = m.createEmail() | |
testCase = TestCase(901) | |
testCase.result = "PASS" | |
driver.get(self.baseUrl + "/member/") |
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
coupon = user.get_coupon() | |
if coupon <= 1: | |
#if the user doesn't have any coupon, give warning | |
message = "You don/'t have any coupon to cancel" | |
else: | |
#open coupon cancellation page | |
show_cancellation_page() |
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
require 'rubygems' | |
require 'capybara' | |
require 'capybara-webkit' | |
require 'capybara/dsl' | |
require 'capybara/rspec' | |
require 'capybara/poltergeist' | |
Capybara.run_server = false | |
Capybara.app_host = 'http://www.amazon.com' | |
Capybara.default_driver = :selenium |
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
Feature: As a customer | |
In order to buy something | |
From the amazon.com | |
I want to login the page | |
Scenario: User goes to login page | |
Given I am on home page of Amazon | |
When I click "Hello. Sign in" button | |
Then I should see login form |
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
import org.python.antlr.ast.Str; | |
import org.python.core.PyObject; | |
import org.python.util.PythonInterpreter; | |
public class ProjectName{ | |
public String createEmail() { | |
PythonInterpreter python = new PythonInterpreter(); | |
// full path of the python file | |
python.execfile("D:\\workspace\\pojectname\\src\\com\\base\\test_data.py"); |
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
Feature: New member | |
As A user | |
I Want to become member | |
So That I buy something | |
Background: User open sign-up page | |
Given I go to home page | |
When I click "sign-up button" | |
@javascript |
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
require 'capybara/dsl' | |
include Capybara::DSL | |
Capybara.default_driver = :selenium | |
visit "http://www.amazon.com/" | |
# the screen size will be fixed as the following resolution | |
# then navigation bar is expected to fill full size of header. | |
# if there is a scroll bar, its width shoul be subtracted as 15px. |
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
require 'net/imap' | |
class TestData | |
def initialize() | |
@emailBase = "username" | |
@emailSup = "gmail.com" | |
@password = "password" | |
@emails = "" | |
end |
OlderNewer