-
Notifications
You must be signed in to change notification settings - Fork 3
Change type to var #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 4 commits
bc0b98d
eb3934e
e85219c
82964a0
410e80c
11190ad
f02720e
54cd243
db6ae4a
ca7a5f9
ebe2311
832d1ed
a6363ec
f6701fe
844c366
3588390
04fcb79
6810e52
28c9a88
9be2a4e
f35bbeb
79f2e79
4d84e10
6eb407c
04ee4c9
362ce7d
fa23796
446951c
4050880
d02ffb4
4c1865d
3dde365
bbaf053
4a07108
e6c496d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,17 +22,15 @@ public static HomePage homepage() | |
| clearBrowserCookies(); | ||
| // open home page | ||
| open(Neodymium.configuration().url()); | ||
| HomePage homePage = new HomePage(); | ||
| homePage.isExpectedPage(); | ||
| return homePage; | ||
| return new HomePage().isExpectedPage(); | ||
| }; | ||
|
||
|
|
||
| @Given("^login page is loaded$") | ||
| @Step("open login page") | ||
| public static LoginPage loginPage() | ||
| { | ||
| // open login page and check for expected page | ||
| LoginPage loginPage = homepage().userMenu.openLogin(); | ||
| var loginPage = homepage().userMenu.openLogin(); | ||
| loginPage.isExpectedPage(); | ||
|
||
| return loginPage; | ||
| }; | ||
|
|
@@ -42,7 +40,7 @@ public static LoginPage loginPage() | |
| public static RegisterPage registerPage() | ||
| { | ||
| // open login page and check for expected page | ||
| RegisterPage registerPage = homepage().userMenu.openRegister(); | ||
| var registerPage = homepage().userMenu.openRegister(); | ||
| registerPage.isExpectedPage(); | ||
|
||
| return registerPage; | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,24 +33,24 @@ public OrderSupport(GlobalStorage storage) | |
| @Given("^new user with \"([^\"]*)\", \"([^\"]*)\", \"([^\"]*)\", \"([^\"]*)\" is registered and logged in$") | ||
| public void registerAndLogIn(String firstName, String lastName, String email, String password) | ||
| { | ||
| RegisterPage registerPage = OpenPageFlows.registerPage(); | ||
| var registerPage = OpenPageFlows.registerPage(); | ||
| registerPage.isExpectedPage(); | ||
|
||
| storage.user = new User(firstName, lastName, email, password); | ||
| registerPage.sendRegisterForm(firstName, lastName, email, password, password); | ||
| LoginPage loginPage = registerPage.userMenu.openLogin(); | ||
| var loginPage = registerPage.userMenu.openLogin(); | ||
| loginPage.isExpectedPage(); | ||
| loginPage.sendLoginform(email, password); | ||
| } | ||
|
|
||
| @Then("^all the products are to find in order history$") | ||
| public void validateOrderInOrderHistory() | ||
| { | ||
| AccountOverviewPage accountOverview = new HomePage().userMenu.openAccountOverview(); | ||
| accountOverview.isExpectedPage(); | ||
| OrderHistoryPage orderHistory = accountOverview.openOrderHistory(); | ||
| var accountOverviewPage = new HomePage().userMenu.openAccountOverview(); | ||
| accountOverviewPage.isExpectedPage(); | ||
| var orderHistoryPage = accountOverviewPage.openOrderHistory(); | ||
| for (Product product : storage.products) | ||
|
||
| { | ||
| orderHistory.validateContainsProduct(product); | ||
| orderHistoryPage.validateContainsProduct(product); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -65,25 +65,25 @@ public void openProductPageAndAddItoTheCart(String productUrl, String size, Stri | |
| @When("I add this product with size \"([^\"]*)\" and style \"([^\"]*)\" to the cart$") | ||
| public void addProductToCart(String size, String style) | ||
| { | ||
| ProductdetailPage productPage = new ProductdetailPage(); | ||
| productPage.setSize(size); | ||
| productPage.setStyle(style); | ||
| var productDetailPage = new ProductdetailPage(); | ||
| productDetailPage.setSize(size); | ||
| productDetailPage.setStyle(style); | ||
|
|
||
| Product product = storage.addProduct(productPage.getProduct()); | ||
| var product = storage.addProduct(productDetailPage.getProduct()); | ||
|
|
||
| productPage.addToCart(); | ||
| productPage.miniCart.openMiniCart(); | ||
| productPage.miniCart.validateMiniCartByProduct(product); | ||
| productDetailPage.addToCart(); | ||
| productDetailPage.miniCart.openMiniCart(); | ||
| productDetailPage.miniCart.validateMiniCartByProduct(product); | ||
| } | ||
|
|
||
| @When("^I specify the shipping address \"([^\"]*)\", \"([^\"]*)\", \"([^\"]*)\", \"([^\"]*)\", \"([^\"]*)\", \"([^\"]*)\", \"([^\"]*)\" and use it for billing$") | ||
| public void openFillAndSendShippingFormUseForBilling(String name, String company, String address, String city, String state, String zip, String country) | ||
| { | ||
| CartPage cartPage = new ProductdetailPage().miniCart.openCartPage(); | ||
| var cartPage = new ProductdetailPage().miniCart.openCartPage(); | ||
| cartPage.isExpectedPage(); | ||
| ShippingAddressPage shippingPage = cartPage.openShippingPage(); | ||
| shippingPage.isExpectedPage(); | ||
| shippingPage.sendShippingAddressForm(name, company, address, city, state, zip, country, true); | ||
| var shippingAddressPage = cartPage.openShippingPage(); | ||
| shippingAddressPage.isExpectedPage(); | ||
| shippingAddressPage.sendShippingAddressForm(name, company, address, city, state, zip, country, true); | ||
| storage.shippingAddress = new Address(name, company, address, city, state, zip, country); | ||
| storage.billingAddress = new Address(name, company, address, city, state, zip, country); | ||
| new PaymentPage().isExpectedPage(); | ||
|
|
@@ -92,31 +92,31 @@ public void openFillAndSendShippingFormUseForBilling(String name, String company | |
| @When("^I enter payment data \"([^\"]*)\", \"([^\"]*)\", \"([^\"]*)\", \"([^\"]*)\"$") | ||
| public void fillAndSendPaymentForm(String name, String cardNumber, String month, String year) | ||
| { | ||
| PaymentPage paymentPage = new PaymentPage(); | ||
| var paymentPage = new PaymentPage(); | ||
| paymentPage.isExpectedPage(); | ||
| PlaceOrderPage placeOrder = paymentPage.sendPaymentForm(cardNumber, name, month, year); | ||
| var placeOrderPage = paymentPage.sendPaymentForm(cardNumber, name, month, year); | ||
| storage.creditcard = new CreditCard(name, cardNumber, "xxxx xxxx xxxx " + cardNumber.substring(12, 16), month, year); | ||
| placeOrder.isExpectedPage(); | ||
| placeOrderPage.isExpectedPage(); | ||
| } | ||
|
|
||
| @Then("^I see all the products in order overview$") | ||
| public void validateContainsAllProductsWithCorrectPricesAndAmount() | ||
| { | ||
| double subtotal = 0.0; | ||
| PlaceOrderPage placeOrder = new PlaceOrderPage(); | ||
| var placeOrderPage = new PlaceOrderPage(); | ||
| for (Product product : storage.products) | ||
| { | ||
| placeOrder.validateContainsProduct(product); | ||
| placeOrderPage.validateContainsProduct(product); | ||
| subtotal += product.getTotalPrice(); | ||
| } | ||
| placeOrder.validateSubtotal(PriceHelper.format(subtotal)); | ||
| placeOrderPage.validateSubtotal(PriceHelper.format(subtotal)); | ||
| } | ||
|
|
||
| @Then("^my shipping and billing addresses as well as payment data are displayed correctly") | ||
| public void validateAddressesAndPaymentData() | ||
| { | ||
| PlaceOrderPage placeOrder = new PlaceOrderPage(); | ||
| placeOrder.validateAddressesAndPayment(storage.shippingAddress, storage.billingAddress, storage.creditcard); | ||
| var placeOrderPage = new PlaceOrderPage(); | ||
| placeOrderPage.validateAddressesAndPayment(storage.shippingAddress, storage.billingAddress, storage.creditcard); | ||
| } | ||
|
|
||
| @Then("^my order is successfully placed$") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| /** | ||
| * | ||
| */ | ||
| package posters.dataobjects; | ||
|
|
||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| /** | ||
| * | ||
| */ | ||
| package posters.dataobjects; | ||
|
|
||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| /** | ||
| * | ||
| */ | ||
| package posters.dataobjects; | ||
|
|
||
| import com.xceptance.neodymium.util.Neodymium; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| /** | ||
| * | ||
| */ | ||
| package posters.dataobjects; | ||
|
|
||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| /** | ||
| * | ||
| */ | ||
| package posters.pageobjects.components; | ||
|
|
||
| import static com.codeborne.selenide.Condition.exist; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oomelianchuk Please reuse updateCountOfProduct if possible. We should not implement the same functions again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done