codeception

Codeception - Can't connect to Webdriver (Acceptance Test)

半腔热情 提交于 2021-02-09 09:20:44
问题 I can access url and create sessions: http://localhost:4444/wd/hub/static/resource/hub.html but when i execute ./codecept run i get an error, but i have Selenium Server running: [ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running. To execute Selenium Server, i used this command: java -Dwebdriver.gecko.driver=./geckodriver -jar "selenium-server-standalone-3.12.0.jar" I tried too with IE and Chrome (i

Codeception - Can't connect to Webdriver (Acceptance Test)

江枫思渺然 提交于 2021-02-09 09:20:20
问题 I can access url and create sessions: http://localhost:4444/wd/hub/static/resource/hub.html but when i execute ./codecept run i get an error, but i have Selenium Server running: [ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running. To execute Selenium Server, i used this command: java -Dwebdriver.gecko.driver=./geckodriver -jar "selenium-server-standalone-3.12.0.jar" I tried too with IE and Chrome (i

How to run Codeception functional tests against a custom frameworkless web application? (that implements PSR-15 RequestHandlerInterface)

大兔子大兔子 提交于 2021-01-29 09:07:40
问题 Assume the following simple web app: <?php // src/App/App.php namespace Practice\Sources\App; use Closure; use Laminas\Diactoros\ServerRequestFactory; use Laminas\HttpHandlerRunner\Emitter\SapiEmitter; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Server\RequestHandlerInterface; class App implements RequestHandlerInterface { private Closure $requestProvider; private ResponseFactoryInterface

How to stop Github Actions step when functional tests failed (using Codeception)

拥有回忆 提交于 2021-01-28 13:51:38
问题 I'm new with Github Actions and I try to make some continuous integration with functional tests. I use Codeception and my workflow run perfectly, but when some tests fail the step is written as success. Github don't stop the action and continue to run the nexts steps. Here is my workflow yml file : name: Run codeception tests on: push: branches: [ feature/functional-tests/codeception ] jobs: build: runs-on: ubuntu-latest steps: # —— Setup Github Actions 🐙 —————————————————————————————————————

How to stop Github Actions step when functional tests failed (using Codeception)

风格不统一 提交于 2021-01-28 13:47:41
问题 I'm new with Github Actions and I try to make some continuous integration with functional tests. I use Codeception and my workflow run perfectly, but when some tests fail the step is written as success. Github don't stop the action and continue to run the nexts steps. Here is my workflow yml file : name: Run codeception tests on: push: branches: [ feature/functional-tests/codeception ] jobs: build: runs-on: ubuntu-latest steps: # —— Setup Github Actions 🐙 —————————————————————————————————————

docker selenium/standalone-chrome unable to connect to docker web server

ⅰ亾dé卋堺 提交于 2020-05-29 16:14:33
问题 I am trying to use codeception to run tests for a php web site which was developed using docker containers. I created a test folder in the web container and put there codecept.phar. This is the project's setup: docker-compose.yml: version: '3' services: db: image: mariadb restart: always volumes: - ./db:/var/lib/mysql ports: - '3306:3306' environment: MYSQL_ROOT_PASSWORD: root web: build: . restart: always tty: true volumes: - ./src:/var/www - ./build/php.ini:/usr/local/etc/php/php.ini ports:

docker selenium/standalone-chrome unable to connect to docker web server

寵の児 提交于 2020-05-29 16:14:26
问题 I am trying to use codeception to run tests for a php web site which was developed using docker containers. I created a test folder in the web container and put there codecept.phar. This is the project's setup: docker-compose.yml: version: '3' services: db: image: mariadb restart: always volumes: - ./db:/var/lib/mysql ports: - '3306:3306' environment: MYSQL_ROOT_PASSWORD: root web: build: . restart: always tty: true volumes: - ./src:/var/www - ./build/php.ini:/usr/local/etc/php/php.ini ports:

Mock method from the same class that tested method is using

瘦欲@ 提交于 2020-01-24 14:34:40
问题 I have following code: class Foo() { public function someMethod() { ... if ($this->otherMethod($lorem, $ipsum)) { ... } ... } } and I'm trying to test the someMethod(), I don't want to test otherMethod() since it's quite complex and I have dedicated tests - here I would only like to mock it and return specific values. So I tried to: $fooMock = Mockery::mock(Foo::class) ->makePartial(); $fooMock->shouldReceive('otherMethod') ->withAnyArgs() ->andReturn($otherMethodReturnValue); and in test I'm

Mock method from the same class that tested method is using

会有一股神秘感。 提交于 2020-01-24 14:33:13
问题 I have following code: class Foo() { public function someMethod() { ... if ($this->otherMethod($lorem, $ipsum)) { ... } ... } } and I'm trying to test the someMethod(), I don't want to test otherMethod() since it's quite complex and I have dedicated tests - here I would only like to mock it and return specific values. So I tried to: $fooMock = Mockery::mock(Foo::class) ->makePartial(); $fooMock->shouldReceive('otherMethod') ->withAnyArgs() ->andReturn($otherMethodReturnValue); and in test I'm