Я хочу запустить локальный сервер и запустить автотест по конфигурации в файле pom.xml
, как показано ниже
<execution>
<id>Run GUI</id>
<phase>pre-integration-test</phase>
<configuration>
<target>
<exec executable="cmd.exe" dir="${project.basedir}\src\main\resources">
<arg value="/c"/>
<arg value="${project.basedir}\src\main\resources\webapp\test\AutoTestWB\ui5-automation-framework\RunGUI.bat"/>
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>Run AutoTestWB</id>
<phase>post-integration-test</phase>
<configuration>
<target>
<exec executable="cmd" dir="${project.basedir}/src/main/resources/webapp/test/AutoTestWB/ui5-automation-framework/UI5Example"
failonerror="true" osfamily="windows">
<arg line="/c node ..\protractor\bin\protractor conf.js" />
</exec>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
Первое выполнение выполнено и сервер запущен
[exec]
C:\Users\*******\Desktop\BaseWB\SampleWorkbench\SampleWorkbench\src\main\resources>gulp serve
[exec] [17:24:53] Using gulpfile ~\Desktop\BaseWB\SampleWorkbench\SampleWorkbench\src\main\resources\gulpfile.js
[exec] [17:24:53] Starting 'serve'...
[exec] [17:24:53] Finished 'serve' after 165 ms
[exec] [17:24:53] Starting 'preload'...
[exec] [17:24:53] Starting 'minify-css'...
[exec] [17:24:53] Finished 'minify-css' after 28 μs
[exec] [17:24:53] Starting 'copy-file'...
[exec] [17:24:53] Finished 'copy-file' after 1.3 ms
[exec] [17:24:53] Finished 'clean' after 207 ms
[exec] [17:24:53] Finished 'sass' after 232 ms
[exec] [Browsersync] Access URLs:
[exec] -------------------------------------
[exec] Local: http://localhost:3000
[exec] External: http://172.16.6.241:3000
[exec] -------------------------------------
[exec] UI: http://localhost:3001
[exec] UI External: http://localhost:3001
[exec] -------------------------------------
[exec] [Browsersync] Serving files from: webapp
[exec] [17:25:28] SyntaxError in plugin "gulp-uglify-es"
[exec] Message:
[exec] 'return' outside of function
[exec] Details:
[exec] filename: test\AutoTestWB\ui5-automation-framework\node_modules\mkdirp\bin\cmd.js
[exec] line: 13
[exec] col: 4
[exec] pos: 313
[exec]
[exec] [17:25:28] gulp-ui5-preload number of files combined to preload file Component-preload.js: 523
[exec] [17:25:28] Finished 'preload' after 35 s
[exec] [17:25:28] Starting 'create-dist'...
[exec] [17:25:28] Finished 'create-dist' after 2.3 μs
Но пока следующее выполнение ожидает первого завершения;первый не отвечает.
Итак, я попытался остановить порт первого
[exec] [17:25:28] gulp-ui5-preload number of files combined to preload file Component-preload.js: 523
[exec] [17:25:28] Finished 'preload' after 35 s
[exec] [17:25:28] Starting 'create-dist'...
[exec] [17:25:28] Finished 'create-dist' after 2.3 μs
[exec] Result: 1
[INFO] Executed tasks
[INFO]
[INFO] --- maven-antrun-plugin:1.6:run (Run AutoTestWB) @ SampleWorkbench ---
[INFO] Executing tasks
main:
[exec] (node:828) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[exec] [17:30:16] I/launcher - Test Coverage:false
[exec] [17:30:16] I/launcher - Running 1 instances of WebDriver
[exec] [17:30:16] I/direct - Using ChromeDriver directly...
[exec] Started
[exec] Jasmine started
[exec] F
[exec] FORMAT CONVERSATION
[exec] × Step 1: Navigate to Format Conversation tab
[exec] - Failed: No tab found!
[exec] F × Step 2: Click on Source format select box
[exec] - Failed: No tab found. The action failed!
[exec] F × Step 3: Choose Source format
[exec] - Failed: No tab found. The action failed!
[exec] F × Step 4: Enter value for Source content
[exec] - Failed: No view found. The action failed!
[exec] F × Step 5: Click on Target format select box
[exec] - Failed: No view found. The action failed!
[exec] F × Step 6: Choose Target format
[exec] - Failed: No view found. The action failed!
[exec] F × Step 7: Do Convert
[exec] - Failed: No tab found. The action failed!
[exec] F × Step 8: Result
[exec] - Failed: No element found!
[exec]
, и будет выполнено следующее выполнение, но оно не будет выполнено, потому что это автоматическое тестирование, для которого сначала требуется серверисполнение, начинается.
Пожалуйста, помогите мне!Спасибо