/**
 * Created with IntelliJ IDEA.
 * User: jhasmanyquiroz
 * Date: 11/10/15
 * Time: 11:00 AM
 * To change this template use File | Settings | File Templates.
 */
package steps;

import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import ui.PageTransporter;
import ui.pages.HomePage;
import ui.pages.LoginPage;
import ui.pages.MainPage;

import static org.testng.Assert.assertTrue;

public class LoginSteps {
    private static PageTransporter page = PageTransporter.getInstance();
    private HomePage homePage;
    private LoginPage loginPage;
    private MainPage mainPage;

    @Given("^I navigate to Login page$")
    public void navigateLoginPage(){
        mainPage = page.navigateToMainPage();
        loginPage = mainPage.clickLogInButton();
    }

    @When("^I login as \"(.*?)\" with password \"(.*?)\"$")
    public void loginAs(String userName, String userPassword){
        homePage = loginPage.loginSuccessful(userName, userPassword);
    }

    @Then("^I should login successfully.$")
    public void shouldLoginSuccessfully(){
        assertTrue(homePage.isPartnersDisplayed(), "User Name displayed");
    }
}
@@ -173,16 +173,54 @@
 steps;%0A%0A
+import cucumber.api.PendingException;%0A
 import c
@@ -1208,10 +1208,616 @@
 );%0A    %7D
+%0A%0A    @When(%22%5EI want to close session$%22)%0A    public void iWantToCloseSession() %7B%0A        loginPage = page%0A                    .navigateToHomePage()%0A                    .clickAuthenticatedDropdownButton()%0A                    .clickSignOutButton();%0A    %7D%0A%0A    @Then(%22%5EI should logout successfully.$%22)%0A    public void iShouldLogoutSuccessfully() %7B%0A        //assertTrue(loginPage.isLogoCourseraPresent(), %22Logo Coursera Displayed.%22);%0A        assertTrue(loginPage.isMissionCourseraPresent(), %22Mission Coursera Displayed.%22);%0A        assertTrue(loginPage.isAccountLoginPresent(), %22Account Login Displayed%22);%0A    %7D
 %0A%7D

Add steps for feature logout