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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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
Posted in Bitbucket

How do you use the Bitbucket-Jira integration? How does it help your team?

Hey everyone, over the past year, we've added several new features on how you can use Bitbucket and Jira together. We'd love to know how you'll are using the integration and how it's helping your t...

105 views 0 2
Join discussion

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