Test
  • Introduction
  • Regression Testing
  • Unit Test
  • reflection
  • terminology
  • Defect Life Cycle
  • NullVSNotNull
  • @Before VS @BeforeEach VS...
  • JUnit Runner
  • run only functional test or integration test
  • cucumber/tags
  • cucumber/ options
  • cucumber/runwith
  • parallel cucumber test
  • cucumber/some eg
  • Hamcrest for testing
  • continuous integration
  • work flow for functional test
  • unit test for server side
  • other
  • Mock
  • jacoco&mutation
  • PowerMockito
  • performance test
Powered by GitBook
On this page

Was this helpful?

cucumber/some eg

eg1:

    /**
     * Initiates the request
     */
    protected void initConfiguration() {
        configuration = new CompositeConfiguration();
        try {
            configuration.addConfiguration(new SystemConfiguration());
            configuration.addConfiguration(new Configurations()
                    .properties(System.getProperty("env", TESTING_ENVIRONMENT_QA)
                            + "-config.properties"));
            RestAssured.baseURI = System.getProperty("linkSaveUrl", configuration.getString(linkSaveUrlProperty));
            request = RestAssured.given();
            addHeaders();
        } catch (ConfigurationException ex) {
            logger.error(ITBase.class.getName(), ex);
        }
    }

eg2:

private void initConfiguration() {
        configuration = new CompositeConfiguration();
        try {
            configuration.addConfiguration(new SystemConfiguration());
            configuration.addConfiguration(new Configurations()
                    .properties(System.getProperty("env", "qa")
                            + "-config.properties"));
            cartUrl = configuration.getString("cart.url");
            checkoutUrl = configuration.getString("checkout.url");
            cartComponentUrl = configuration.getString("cart.component.url");
            cartComponentV1Url = configuration.getString("cart.component.v1.url");
            EBTUrl = configuration.getString("ao.url");
            ebtSafUrl = configuration.getString("saf.url");
            shifuVariantUrl =  configuration.getString("setMockVariant.url");
            omUrl = configuration.getString("om.url");
            oeomUrl = configuration.getString("oeom.url");
            deviceUrl = configuration.getString("device.url");
            posCacheUrl = configuration.getString("posCache.url");
            tlogUrl = configuration.getString("tlogService.url");
            posVoidUrl = configuration.getString("posVoid.url");
            cartV1Url = configuration.getString("cart.v1.url");
            operatorAuthUrl = configuration.getString("operatorAuth.url");
            oePostAuthUrl = configuration.getString("oe.postAuth.url");
            itemInquiryUrl = configuration.getString("itemInquire.url");
            omStatusCodeUrl = configuration.getString("omStatusCode.url");
            checkoutComponentUrl = configuration.getString("checkout.component.url");
            updateSessionUrl = configuration.getString("updateSession.url");
            getOESessionUrl = configuration.getString("getSession.uri");
            getOECarWashUrl=configuration.getString("getOeCarWash.url");
        } catch (ConfigurationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

eg3:

And Another WEIGHTED_ITEM and "9781782351788" is added to the cart
||
@And("^Another WEIGHTED_ITEM and \"([^\"]*)\" is added to the cart$")
...
Previousparallel cucumber testNextHamcrest for testing

Last updated 5 years ago

Was this helpful?