In my project,there is a TestBase class. All tests in the future will extend
from this class.
I have just created a basic test extends from that class. Then maven clean
install => Build success.
Next I  select maven test. It failed.

I try to debug backing up code from Test Base and add basic code to run and
It failed when I add some codes relating to testing. It passed with syso
only.

I will work on this project and maintain it. The problem is I dont know
where the issue from: my test or maven or report??? Actually code in test
very basic...

I hope receive more ideas about it.... :(

This is the real code in Test Base
=================================
package com.validant.enigma3.common;

import org.testng.Assert;
import org.testng.ITestContext;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Parameters;

import com.validant.enigma3.controls.ExtWebDriver;

public class TestBase {
        
        protected ExtWebDriver driver;
        protected UIMap uimap;
        
        @Parameters({Constants.PARAM_LOCAL_URL})
        @BeforeSuite(alwaysRun = true)
        public void beforeSuite(ITestContext context, String localurl){
                // get all UI controls
                try
                {
                        uimap = new UIMap(Configuration.getUIMapFile(),
Utils.getClassName(this));
                
                        //init web driver
                        driver = new ExtWebDriver(localurl);
                
                        // add driver into context. This is used for 
ScreenshotHTMLReporter
                        context.setAttribute(Constants.CON_DRIVER_ATTR, 
driver.getWebDriver());
                }
                catch (Exception ex)
                {
                        Assert.assertTrue(false, ex.getMessage());
                }
                
        }
        
        @AfterSuite
        public void afterSuite() {
                // do something
        }
        
        @BeforeTest
        public void beforeTest()
    {
                // launch the web application under test
        driver.launch();
        
        // wait for the page loaded successfully
        driver.waitForPageLoaded();
    }  
    
   @AfterTest
   public void afterTest()
   {
                // close browser
                driver.quit();   
   }
   
}
================================
This is my basic class test:

package com.validant.enigma3.samples;

import java.io.File;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;

import com.validant.enigma3.common.TestBase;
import com.validant.enigma3.common.UIMap;

public class HoangTest extends TestBase{

        @Test
        public void myTest1()
        {
                System.out.println("START MY NEW TEST_01");
        }
        
        @Test
        public void myTest2()
        {
                System.out.println("START MY NEW TEST_02");
        }
}

=========================
And pom file is the same previous post

There is no report in this case. Just only report  pass cases and failed
cases that return assert false... (as i know from the author of this project
but she left... :(  )

Thank you
Hoang




--
View this message in context: 
http://maven.40175.n5.nabble.com/Error-when-using-Maven-for-test-project-I-need-a-help-tp5768218p5768310.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to