Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is there a way to search the entire repo for a certain value within all .java files?

Socko-71 June 16, 2021

We have our automation scripts within Bitbucket for multiple applications. This is an on-going activity wherein, we will keep adding scripts to bitbucket on daily basis. The testcases are written inside a .java file.  A testcase can be identified with a tag “@Test”.   The below example is a single testcase. We like a count returned for all the testcases in the repo

Eg:

@TEST

    public void whenRequestingAPolicy_thenSubmitTheRequest() {

        start();

        AccountSummaryUser user = new UserFactory().retrieveAccountSummaryData("commonUser1Ifbi");

        new LoginPage(driver).submitLogin(user.getUsername(), user.getPassword());

        ContactUsPage contactUsPage = new MenuWorkflow(driver).accessContactUs();

        assertTrue(contactUsPage.isAt());

 

        contactUsPage.selectATopicDropdown.select("Policy");

        Select options = new Select(contactUsPage.selectAPolicyTypeElement);

        options.selectByIndex(3);

        String requestAPolicyComments = randomAlphanumeric(8);

        contactUsPage.comments.input(requestAPolicyComments);

        ContactUsConfirmationPage contactUsConfirmationPage = contactUsPage.clickContinueButton();

 

        assertTrue(contactUsConfirmationPage.isAtContactUsConfirmation());

        dateTimeTestScript = new DateTime();

 

        System.out.println("CONTACT IS POLICY EMAIL SENT TIME TEST SCTIPT " + dateTimeTestScript);

        assertEquals("Customer Topic: Policy", new OwaPage(driver).getContactUsText(requestAPolicyComments));

    }

I tried the search option in BitBucket for "@Test" but it returns all code that has the value "test".

1 answer

1 accepted

0 votes
Answer accepted
Ulrich Kuhnhardt _IzymesCo_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 16, 2021

I don't have a direct solution - but what about parsing test result files / reports?

Socko-71 June 17, 2021

Are you talking using the addon Bamboo?

Ulrich Kuhnhardt _IzymesCo_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 17, 2021

Yes - your CI system would make test results and stats readily available.

I assumed that you need to 'count' tests to report on increased test coverage/count?

Socko-71 June 18, 2021

Yes, that's exactly what they are wanting to do.  Thanks again...Want a job...you can have mine!!!  LOL

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events