<commit_before>package vmcTest.tests

import org.junit.Test
import vmcTest.pages.*
import geb.Page.*

class AdminDrTest extends TestBase {
    // called before each test
    def setup() {
        int count = 0
        while(count<numberOfTrials) {
            count ++
            try {
                setup: 'Open VMC page'
                to VoltDBManagementCenterPage
                expect: 'to be on VMC page'
                at VoltDBManagementCenterPage

                when: 'click the Admin link (if needed)'
                page.openAdminPage()
                then: 'should be on Admin page'
                at AdminPage

                break
            } catch (org.openqa.selenium.ElementNotVisibleException e) {
                println("ElementNotVisibleException: Unable to Start the test")
                println("Retrying")
            }
        }
    }

    def "Check all the titles and labels in Database Replication (DR) section"(){
        boolean result = page.CheckIfDREnabled();
        expect: "Database Replication (DR) titles and labels are displayed"
        if(result){
            waitFor(waitTime){page.DrTitle.isDisplayed()}
            waitFor(waitTime){page.DrTitle.text().toLowerCase().equals("Database Replication (DR)".toLowerCase())}
            println("Database Replication (DR) is displayed")

            waitFor(waitTime){page.drId.isDisplayed()}
            waitFor(waitTime){page.drId.text().toLowerCase().equals("ID".toLowerCase())}
            println("Label, Id is displayed")

            waitFor(30){page.master.isDisplayed()}
            waitFor(30){page.master.text().toLowerCase().equals("Master".toLowerCase())}
            println("Label, master is displayed")

            waitFor(30){page.drTables.isDisplayed()}
            waitFor(30){page.drTables.text().toLowerCase().equals("DR Tables".toLowerCase())}
            println("Label, DR Tables is displayed")

            waitFor(30){page.replica.isDisplayed()}
            waitFor(30){!page.replica.text().equals("")}
            println("Label, replica is displayed")

        } else{
            println("DR is not enabled. DR should be enable to check all the titles and labels in Database Replication (DR) section.")
        }
    }

    def "Check the values of DR id, master, and replica Source"(){
        when:
        at AdminPage
        then:
        int count = 0
        boolean testStatus = false
        boolean result = page.CheckIfDREnabled();
        if(result){
            while(count<numberOfTrials) {
                count ++
                try {
                    when:
                        waitFor(waitTime){
                            page.drIdValue.isDisplayed()
                            !page.drIdValue.text().equals("")
                        }
                        println("DR id has proper value")

                        waitFor(waitTime){
                            page.masterValue.isDisplayed()
                            !page.masterValue.text().equals("")
                        }
                        println("DR master has proper value")
<commit_msg>Removed a test case.<commit_after>package vmcTest.tests

import org.junit.Test
import vmcTest.pages.*
import geb.Page.*

class AdminDrTest extends TestBase {
    // called before each test
    def setup() {
        int count = 0
        while(count<numberOfTrials) {
            count ++
            try {
                setup: 'Open VMC page'
                to VoltDBManagementCenterPage
                expect: 'to be on VMC page'
                at VoltDBManagementCenterPage

                when: 'click the Admin link (if needed)'
                page.openAdminPage()
                then: 'should be on Admin page'
                at AdminPage

                break
            } catch (org.openqa.selenium.ElementNotVisibleException e) {
                println("ElementNotVisibleException: Unable to Start the test")
                println("Retrying")
            }
        }
    }

    def "Check all the titles and labels in Database Replication (DR) section"(){
        boolean result = page.CheckIfDREnabled();
        expect: "Database Replication (DR) titles and labels are displayed"
        if(result){
            waitFor(waitTime){page.DrTitle.isDisplayed()}
            waitFor(waitTime){page.DrTitle.text().toLowerCase().equals("Database Replication (DR)".toLowerCase())}
            println("Database Replication (DR) is displayed")

            waitFor(waitTime){page.drId.isDisplayed()}
            waitFor(waitTime){page.drId.text().toLowerCase().equals("ID".toLowerCase())}
            println("Label, Id is displayed")

            waitFor(30){page.master.isDisplayed()}
            waitFor(30){page.master.text().toLowerCase().equals("Master".toLowerCase())}
            println("Label, master is displayed")

            waitFor(30){page.drTables.isDisplayed()}
            waitFor(30){page.drTables.text().toLowerCase().equals("DR Tables".toLowerCase())}
            println("Label, DR Tables is displayed")

            waitFor(30){page.replica.isDisplayed()}
            waitFor(30){!page.replica.text().equals("")}
            println("Label, replica is displayed")

        } else{
            println("DR is not enabled. DR should be enable to check all the titles and labels in Database Replication (DR) section.")
        }
    }

    def "Check the values of DR id, master, and replica Source"(){
        when:
        at AdminPage
        then:
        int count = 0
        boolean testStatus = false
        boolean result = page.CheckIfDREnabled();
        if(result){
            while(count<numberOfTrials) {
                count ++
                try {
                    when:
//                        waitFor(waitTime){
//                            page.drIdValue.isDisplayed()
//                            !page.drIdValue.text().equals("")
//                        }
//                        println("DR id has proper value")

                        waitFor(waitTime){
                            page.masterValue.isDisplayed()
                            !page.masterValue.text().equals("")
                        }
                        println("DR master has proper value")

{'fraction_non_alphanumeric': 0.1048683160415004, 'fraction_numerical': 0.004469273743016759, 'mean_word_length': 1.6675180928054492, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4881177', 'n_tokens_mistral': 1620, 'n_tokens_neox': 1559, 'n_words': 385}