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
Community Members
Community Events
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



    public void whenRequestingAPolicy_thenSubmitTheRequest() {


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

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

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



        Select options = new Select(contactUsPage.selectAPolicyTypeElement);


        String requestAPolicyComments = randomAlphanumeric(8);


        ContactUsConfirmationPage contactUsConfirmationPage = contactUsPage.clickContinueButton();



        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 can have mine!!!  LOL

Suggest an answer

Log in or Sign up to answer
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