Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,297,306
Community Members
 
Community Events
165
Community Groups

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

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

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

Are you talking using the addon Bamboo?

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?

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
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,214 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you