Есть отличная удаленная работа для php+codeception+jenkins+allure+docker спецов. 100% remote! Присоединиться к проекту

Не получаеться запустить тесты через Maven


(f@zen>) #1

Подскажите , в чем может быть ошибка

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for exemple-test:mini:jar:1.0-Exemlple
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 27, column 33
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 35, column 33
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building exemple 1.0-Exemlple
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ mini ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1251 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Fazen\workspace\CopyProjectFrame\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ mini ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ mini ---
[debug] execute contextualize
[WARNING] File encoding has not been set, using platform encoding Cp1251, i.e. build is platform dependent!
[WARNING] Using platform encoding (Cp1251 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Fazen\workspace\CopyProjectFrame\src\test\resourse
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ mini ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ mini ---
[INFO] Surefire report directory: C:\Users\Fazen\workspace\CopyProjectFrame\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running TestSuite
org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
	at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
	at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
Caused by: org.testng.TestNGException: 
Cannot instantiate class com.exemple.tests.LoginTest
	at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:38)
	at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:374)
	at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:286)
	at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:110)
	at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:195)
	at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:120)
	at org.testng.TestRunner.initMethods(TestRunner.java:405)
	at org.testng.TestRunner.init(TestRunner.java:231)
	at org.testng.TestRunner.init(TestRunner.java:201)
	at org.testng.TestRunner.<init>(TestRunner.java:150)
	at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:523)
	at org.testng.SuiteRunner.init(SuiteRunner.java:157)
	at org.testng.SuiteRunner.<init>(SuiteRunner.java:111)
	at org.testng.TestNG.createSuiteRunner(TestNG.java:1245)
	at org.testng.TestNG.createSuiteRunners(TestNG.java:1232)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1086)
	at org.testng.TestNG.run(TestNG.java:1007)
	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:122)
	at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:101)
	... 9 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29)
	... 28 more
Caused by: java.lang.ExceptionInInitializerError
	at com.exemple.tests.BaseTestCase.getWebDriver(BaseTestCase.java:22)
	at com.exemple.tests.LoginTest.<init>(LoginTest.java:14)
	... 33 more
Caused by: java.lang.NullPointerException
	at com.exemple.utils.ConfigProperties.<clinit>(ConfigProperties.java:15)
	... 35 more

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.026s
[INFO] Finished at: Fri Nov 15 11:51:24 EET 2013
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------

вот pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <artifactId>mini</artifactId>
  <version>1.0-Exemlple</version>
  <packaging>jar</packaging>

  <url>http://maven.apache.org</url>

  <properties>
    <selenium-version>2.35.0</selenium-version>
    <testng-version>6.4</testng-version>
    <java-version>1.7</java-version>
    <suite.file>testng.xml</suite.file>

  </properties>
  <build>

    <testResources>
      <testResource>
        <directory>src/test/resourse</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${java-version}</source>
          <target>${java-version}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <argLine>-Xmx1024m -Xms128M -XX:MaxPermSize=128M -DscreenshotPath=${screenshot.path}
            -Dintegra=${integra}
          </argLine>
          <suiteXmlFiles>
            <suiteXmlFile>${suite.file}</suiteXmlFile>
          </suiteXmlFiles>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>3.1.1</version>
        <configuration>
          <wtpversion>2.0</wtpversion>
          <buildOutputDirectory>
            ${basedir}/eclipse-target
          </buildOutputDirectory>
          <workspace>${basedir}/..</workspace>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>${selenium-version}</version>
    </dependency>
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>${testng-version}</version>
    </dependency>
  </dependencies>
  <groupId>exemple-test</groupId>
  <name>exemple</name>

</project>

(sidelnikovmike) #2

NullPointer виднеется в конце. что-то с настройками?


(Aleksey) #3

здесь смотрите…
И example пишется немного не так, как у вас.