Git Product home page Git Product logo

faladdinqatask's Introduction

Faladdin QA Task

  • This project was built on;
    • Build management tool -> Maven
    • Language -> Java
    • Assertion tool -> TestNG
    • Model -> Page Object Model
    • Report -> extent report base64

Structure

  • In base;
    • BaseStepMethod -> where ready methods are saved
    public class BaseStepMethod {
    
      private static final Logger LOGGER = LogManager.getLogger(BaseStepMethod.class);
    
      protected AndroidDriver<AndroidElement> androidDriver = DriverThread.getDriver();
      private final WebDriverWait wait;
    
      public BaseStepMethod() {
          this.wait = new WebDriverWait(androidDriver, 30);
    
          if (androidDriver.isDeviceLocked())
              androidDriver.unlockDevice();
      }
    }
    • BaseTest -> where platform and application are set to driver before All
    public class BaseTest {
    
     @Parameters({"platformVersion", "deviceName", "appPackage", "appActivity", "appWaitForLaunch"})
      @BeforeClass(alwaysRun = true)
      public void beforeClass(String platformVersion, String deviceName, String appPackage, String appActivity, String appWaitForLaunch) {
          DesiredCapabilities androidCaps = new DesiredCapabilities();
    
          androidCaps.setCapability(MobileCapabilityTypes.PLATFORM_NAME, Platform.ANDROID);
          androidCaps.setCapability(MobileCapabilityTypes.PLATFORM_VERSION, platformVersion);
          androidCaps.setCapability(MobileCapabilityTypes.AUTOMATION_NAME, MobileCapabilityTypes.AUTOMATOR_ANDROID);
          androidCaps.setCapability(MobileCapabilityTypes.DEVICE_NAME, deviceName);
          androidCaps.setCapability(MobileCapabilityTypes.APP_PACKAGE, appPackage);
          androidCaps.setCapability(MobileCapabilityTypes.APP_ACTIVITY, appActivity);
          androidCaps.setCapability(MobileCapabilityTypes.APP_WAIT_FOR_LAUNCH, Boolean.parseBoolean(appWaitForLaunch));
    
          try {
              androidDriver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), androidCaps);
          } catch (MalformedURLException e) {
              LOGGER.error("Driver could not be created! ErrorMessage: " + e.getMessage());
          }
    
          DriverThread.setDriver(androidDriver);
          androidDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
      }
    }
  • In capabilities -> To this interface added Mobile Capability types
public interface MobileCapabilityTypes {
  String PLATFORM_NAME = "platformName";
  String PLATFORM_VERSION = "platformVersion";
  String DEVICE_NAME = "deviceName";
  String APP_PACKAGE = "appPackage";
  String APP_ACTIVITY = "appActivity";
  String APP_WAIT_FOR_LAUNCH = "appWaitForLaunch";
  String AUTOMATION_NAME = "automationName";
  String AUTOMATOR_ANDROID = "UiAutomator2";
}
  • In extentReports;

    • ExtentManager -> It helps us to create meta-data of the report
    • ExtentTestManager -> It includes report methods that help us to generate report details while tests run
  • In listener;

    • AnnotationTransformer -> It analysis tests results
    • Listener -> Includes methods which decide test run situations and get information
    • Retry -> Runs with AnnotationTransformer and re-runs the failed tests
  • In pages

    • AccountPage
    • ExplorePage
    • HomePage
    • LoginTypes
  • In utilities

    • DriverThread -> Helps us to run tests with multi devices
  • In test

    • Login -> tests are called and run this class
    @Test(enabled = true, description = "Faladdin - Login Test")
      public void loginTest(Method method) throws InterruptedException {
          startTest(method.getName(), "Login Scenario with Google");
    
          login = new Login();
          homePage = new HomePage();
          explorePage = new ExplorePage();
          loginTypes = new LoginTypes();
          accountPage = new AccountPage();
    
          getTest().info("User ensures that \"Explore\" button is displayed");
          homePage.ExploreButton_isDisplayed();
    
          getTest().info("User clicks on \"Explore\" button");
          homePage.ExploreButton_isClicked();
    
          getTest().info("User ensures that \"Account\" button is displayed");
          explorePage.AccountButton_isDisplayed();
    
          getTest().info("User clicks on \"Account\" button");
          explorePage.AccountButton_isClicked();
      }
  • testRunner

    • Runner.xml -> runs the tests
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

<suite data-provider-thread-count="1" name="Faladdin" parallel="tests">

    <test name="Faladdin Login Test">
        <parameter name="platformVersion" value="11.0"/>
        <parameter name="deviceName" value="Redmi Note 8"/>
        <parameter name="appPackage" value="com.faladdin.app"/>
        <parameter name="appActivity" value="com.faladdin.app.ui.launcher.LauncherActivity"/>
        <parameter name="appWaitForLaunch" value="false"/>
        <classes>
            <class name="com.faladdin.test.Login"/>
        </classes>
    </test>

</suite>

faladdinqatask's People

Contributors

alpiysl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.