// Path: src/test/java/com/github/wasiqb/coetafs/appium/saucedemo/android/page/LoginPage.java
// public static final String LOGIN_BTN = "Login button";
// 
// Path: src/test/java/com/github/wasiqb/coetafs/appium/saucedemo/android/page/LoginPage.java
// public static final String PASSWORD  = "Password";
// 
// Path: src/test/java/com/github/wasiqb/coetafs/appium/saucedemo/android/page/LoginPage.java
// public static final String USER_NAME = "User Name";
// 
// Path: src/test/java/com/github/wasiqb/coetafs/appium/saucedemo/android/page/LoginPage.java
// public class LoginPage extends AndroidActivity {
//     public static final String LOGIN_BTN = "Login button";
//     public static final String PASSWORD  = "Password";
//     public static final String USER_NAME = "User Name";
// 
//     public LoginPage (final AndroidDevice device) {
//         super (device);
//     }
// 
//     @Override
//     protected DeviceElement prepare () {
//         final DeviceElement page = create ("Login Form").forAndroid (AccessibilityId ("test-Login"));
// 
//         create (USER_NAME).parent (page)
//             .waitStrategy (VISIBLE)
//             .forAndroid (AccessibilityId ("test-Username"));
//         create (PASSWORD).parent (page)
//             .waitStrategy (VISIBLE)
//             .forAndroid (AccessibilityId ("test-Password"));
//         create (LOGIN_BTN).parent (page)
//             .waitStrategy (VISIBLE)
//             .forAndroid (AccessibilityId ("test-LOGIN"));
// 
//         return page;
//     }
// }
// 
// Path: src/main/java/com/github/wasiqb/coteafs/appium/android/AndroidActivityActions.java
// public abstract class AndroidActivityActions
//     extends DeviceActivityActions<AndroidDriver<MobileElement>, AndroidDevice, AndroidTouchAction> {
//     /**
//      * @param device Device instance
//      *
//      * @author wasiq.bhamla
//      * @since Oct 23, 2017 11:05:14 PM
//      */
//     protected AndroidActivityActions (final AndroidDevice device) {
//         super (device);
//     }
// }
// 
// Path: src/main/java/com/github/wasiqb/coteafs/appium/android/AndroidDevice.java
// public class AndroidDevice extends Device<AndroidDriver<MobileElement>, AndroidTouchAction> {
//     /**
//      * @param server Server instance
//      * @param name Device name
//      *
//      * @author wasiq.bhamla
//      * @since 13-Apr-2017 9:12:47 PM
//      */
//     public AndroidDevice (final AppiumServer server, final String name) {
//         super (server, name);
//     }
// 
//     /*
//      * (non-Javadoc)
//      * @see com.github.wasiqb.coteafs.appium.device.Device#startRecordSetting()
//      */
//     @SuppressWarnings ("unchecked")
//     @Override
//     protected AndroidStartScreenRecordingOptions startRecordSetting () {
//         final AndroidStartScreenRecordingOptions options = AndroidStartScreenRecordingOptions.startScreenRecordingOptions ();
//         final AndroidVideoSetting record = this.setting.getPlayback ()
//             .getRecording ()
//             .getAndroid ();
//         if (record.getBitRate () != 4) {
//             options.withBitRate (record.getBitRate ());
//         }
//         if (record.getSize () != null) {
//             options.withVideoSize (record.getSize ());
//         }
//         return options;
//     }
// 
//     /*
//      * (non-Javadoc)
//      * @see com.github.wasiqb.coteafs.appium.device.Device#stopRecordSetting()
//      */
//     @SuppressWarnings ("unchecked")
//     @Override
//     protected AndroidStopScreenRecordingOptions stopRecordSetting () {
//         return AndroidStopScreenRecordingOptions.stopScreenRecordingOptions ();
//     }
// }


import static com.github.wasiqb.coetafs.appium.saucedemo.android.page.LoginPage.LOGIN_BTN;
import static com.github.wasiqb.coetafs.appium.saucedemo.android.page.LoginPage.PASSWORD;
import static com.github.wasiqb.coetafs.appium.saucedemo.android.page.LoginPage.USER_NAME;
import com.github.wasiqb.coetafs.appium.saucedemo.android.page.LoginPage;
import com.github.wasiqb.coteafs.appium.android.AndroidActivityActions;
import com.github.wasiqb.coteafs.appium.android.AndroidDevice;
/*
 *
 *  Copyright (c) 2021, Wasiq Bhamla.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *          http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
package com.github.wasiqb.coetafs.appium.saucedemo.android.actions;



public class SuccessLoginAction extends AndroidActivityActions {
    public SuccessLoginAction (final AndroidDevice device) {
        super (device);
    }

    @Override
    public void perform () {
        final LoginPage loginPage = new LoginPage (getDevice ());
        loginPage.onElement (USER_NAME)
            .enterText (value (USER_NAME));
        loginPage.onElement (PASSWORD)
// Path: src/test/java/com/github/wasiqb/coetafs/appium/saucedemo/android/page/LoginPage.java
// public static final String LOGIN_BTN = "Login button";
// 
// Path: src/test/java/com/github/wasiqb/coetafs/appium/saucedemo/android/page/LoginPage.java
// public static final String PASSWORD  = "Password";
// 
// Path: src/test/java/com/github/wasiqb/coetafs/appium/saucedemo/android/page/LoginPage.java
// public static final String USER_NAME = "User Name";
// 
// Path: src/test/java/com/github/wasiqb/coetafs/appium/saucedemo/android/page/LoginPage.java
// public class LoginPage extends AndroidActivity {
//     public static final String LOGIN_BTN = "Login button";
//     public static final String PASSWORD  = "Password";
//     public static final String USER_NAME = "User Name";
// 
//     public LoginPage (final AndroidDevice device) {
//         super (device);
//     }
// 
//     @Override
//     protected DeviceElement prepare () {
//         final DeviceElement page = create ("Login Form").forAndroid (AccessibilityId ("test-Login"));
// 
//         create (USER_NAME).parent (page)
//             .waitStrategy (VISIBLE)
//             .forAndroid (AccessibilityId ("test-Username"));
//         create (PASSWORD).parent (page)
//             .waitStrategy (VISIBLE)
//             .forAndroid (AccessibilityId ("test-Password"));
//         create (LOGIN_BTN).parent (page)
//             .waitStrategy (VISIBLE)
//             .forAndroid (AccessibilityId ("test-LOGIN"));
// 
//         return page;
//     }
// }
// 
// Path: src/main/java/com/github/wasiqb/coteafs/appium/android/AndroidActivityActions.java
// public abstract class AndroidActivityActions
//     extends DeviceActivityActions<AndroidDriver<MobileElement>, AndroidDevice, AndroidTouchAction> {
//     /**
//      * @param device Device instance
//      *
//      * @author wasiq.bhamla
//      * @since Oct 23, 2017 11:05:14 PM
//      */
//     protected AndroidActivityActions (final AndroidDevice device) {
//         super (device);
//     }
// }
// 
// Path: src/main/java/com/github/wasiqb/coteafs/appium/android/AndroidDevice.java
// public class AndroidDevice extends Device<AndroidDriver<MobileElement>, AndroidTouchAction> {
//     /**
//      * @param server Server instance
//      * @param name Device name
//      *
//      * @author wasiq.bhamla
//      * @since 13-Apr-2017 9:12:47 PM
//      */
//     public AndroidDevice (final AppiumServer server, final String name) {
//         super (server, name);
//     }
// 
//     /*
//      * (non-Javadoc)
//      * @see com.github.wasiqb.coteafs.appium.device.Device#startRecordSetting()
//      */
//     @SuppressWarnings ("unchecked")
//     @Override
//     protected AndroidStartScreenRecordingOptions startRecordSetting () {
//         final AndroidStartScreenRecordingOptions options = AndroidStartScreenRecordingOptions.startScreenRecordingOptions ();
//         final AndroidVideoSetting record = this.setting.getPlayback ()
//             .getRecording ()
//             .getAndroid ();
//         if (record.getBitRate () != 4) {
//             options.withBitRate (record.getBitRate ());
//         }
//         if (record.getSize () != null) {
//             options.withVideoSize (record.getSize ());
//         }
//         return options;
//     }
// 
//     /*
//      * (non-Javadoc)
//      * @see com.github.wasiqb.coteafs.appium.device.Device#stopRecordSetting()
//      */
//     @SuppressWarnings ("unchecked")
//     @Override
//     protected AndroidStopScreenRecordingOptions stopRecordSetting () {
//         return AndroidStopScreenRecordingOptions.stopScreenRecordingOptions ();
//     }
// }


// Path: src/test/java/com/github/wasiqb/coetafs/appium/saucedemo/android/actions/SuccessLoginAction.java
import static com.github.wasiqb.coetafs.appium.saucedemo.android.page.LoginPage.LOGIN_BTN;
import static com.github.wasiqb.coetafs.appium.saucedemo.android.page.LoginPage.PASSWORD;
import static com.github.wasiqb.coetafs.appium.saucedemo.android.page.LoginPage.USER_NAME;
import com.github.wasiqb.coetafs.appium.saucedemo.android.page.LoginPage;
import com.github.wasiqb.coteafs.appium.android.AndroidActivityActions;
import com.github.wasiqb.coteafs.appium.android.AndroidDevice;

/*
 *
 *  Copyright (c) 2021, Wasiq Bhamla.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *          http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
package com.github.wasiqb.coetafs.appium.saucedemo.android.actions;



public class SuccessLoginAction extends AndroidActivityActions {
    public SuccessLoginAction (final AndroidDevice device) {
        super (device);
    }

    @Override
    public void perform () {
        final LoginPage loginPage = new LoginPage (getDevice ());
        loginPage.onElement (USER_NAME)
            .enterText (value (USER_NAME));
        loginPage.onElement (PASSWORD)
            .enterText (PASSWORD);