giorgiosironi / phpunit-selenium

Selenium RC integration for PHPUnit
http://www.phpunit.de/
Other
601 stars 270 forks source link

PHPUnit 7 supports ? #422

Closed mariuszkrzaczkowski closed 5 years ago

mariuszkrzaczkowski commented 6 years ago

When is planned supports with PHPUnit 7

okolesnyk commented 6 years ago

Hello, any updates on this issue?

viamage commented 6 years ago

+1, phpunit is at 7.2 already, can we expect this anytime soon ?

giorgiosironi commented 6 years ago

It's difficult to say what the extend of the changes would be (the changes to namespaces has been a bit disruptive for previous branches) but if someone wants to open and test a PR for master (would go into the 4.x series) I'd be happy to merge it.

thewunder commented 5 years ago

Anyone else working on this? If not, I will do it. We have a large suite of tests that we need to continue to move forward with. Switching to a new framework will certainly take more time than migrating this.

luckydonald commented 5 years ago

@thewunder any progress yet?

thewunder commented 5 years ago

@luckydonald Sorry I haven't started yet. PHPUnit 6 is EOL on February 8th. So it is time to get on this soon.

natewallis commented 5 years ago

How did this progress, I have been developing tests using PHPUnit 8 and this package conflicts with PHPUnit... any suggestions?

thewunder commented 5 years ago

Hey all, I'm finally starting this, I hope to have a pull request this week.

thewunder commented 5 years ago

For the interested https://github.com/thewunder/phpunit-selenium/tree/phpunit_7_plus

@giorgiosironi I have 9 failures, 105 pass, 51 ignored tests right now running on chrome, the vagrant box seems pretty hopelessly out of date.

JaZo commented 5 years ago

@thewunder, great work so far! Can I help to get this done?

Regarding the Vagrant box; we are using https://github.com/elgalu/docker-selenium in our CI and it works like a charm!

iainfogg commented 5 years ago

@giorgiosironi It'd be great to know if this is able to progress, as PhpUnit has been EOL for several months now. Is this something we can expect to see getting merged in, or should we be looking for something else to do PhpUnit / Selenium integration?

And thanks @thewunder for your work on this!

joesaunderson commented 5 years ago

Do we have any update on progress on this?

thewunder commented 5 years ago

Giorgio gave me commit rights. But I would like to have one other person run the tests, take a look at code etc before I merge and release it.

joesaunderson commented 5 years ago

I can have a look this weekend. Will this be supporting PHP unit 7 & 8? Or is this targeting PHP unit 7 specifically?

thewunder commented 5 years ago

RIght now I know everything runs in 8.x but with some deprecation notices.

I think we may need two separate releases because the deprecated class (which we would need for 7 support) was introduced in 7.x

joesaunderson commented 5 years ago

I agree with the two releases. Maybe 5. for 7 support and 6. for 8 support?

What is the deprecated class?

thewunder commented 5 years ago

TestListener and TestListenerDefaultImplementation

thewunder commented 5 years ago

I think we should skip 6 and go directly to 7 then version 7 of the library supports PHPUnit 7, while version 8 supports 8.

Sound good all?

joesaunderson commented 5 years ago

Sounds good, we’d also be skipping 5 too right?

JaZo commented 5 years ago

For the interested https://github.com/thewunder/phpunit-selenium/tree/phpunit_7_plus

@giorgiosironi I have 9 failures, 105 pass, 51 ignored tests right now running on chrome, the vagrant box seems pretty hopelessly out of date.

@thewunder I have fixed some broken tests and changed the Travis config so the tests run on Sauce Labs. I also added a docker-compose.yml file for easy local testing (see https://github.com/JaZo/phpunit-selenium/tree/feature/selenium-docker). The builds are passing now: 118 pass, 28 skipped and 19 incomplete (https://travis-ci.org/JaZo/phpunit-selenium/jobs/548630157). Getting the mobile tests running is still a todo. I can create a PR for this, but we first need to apply for a free OS account at Sauce (https://saucelabs.com/open-source/open-sauce). Maybe @giorgiosironi, as the owner of this repo, can do that and supply me with the details so I can set it up and make a PR? When the tests are running on CI again we can continue the work on PHPUnit 7+ support.

luckydonald commented 5 years ago

Oh, great! @JaZo How ready do you think it is, is it already usable? We are currently planning to add unit and selenium tests to an existing project, and would also go for PHPUnit 8 while setting things up. Selenium however is a fixed requirement.

I'd love to help out manually testing it by trying to use it, if someone gives me some hints in how to install it into a project (are there pre-releases made for composer?)

JaZo commented 5 years ago

@luckydonald you can install it using composer by specifying the repository and branch from the PR (#430). It should be something like this (I haven't tried it):

{
    "repositories": [{
        "type": "git",
        "url": "https://github.com/thewunder/phpunit-selenium.git"
    }],
    "require": {
        "phpunit/phpunit-selenium": "dev-phpunit_7_plus"
    }
}

However, personally I would not recommend this package for new projects as it is not very well maintained. I help to keep it up-to-date because we have a project with a very big test suite relying on this package and it is more work to port all tests. We mostly use Cypress for browser tests now. If Selenium is a requirement, I think you are better off with something like Codeception with the WebDriver module which is properly maintained.

filips123 commented 5 years ago

@JaZo

However, personally I would not recommend this package for new projects as it is not very well maintained.

Why? Alternatives that you listed aren't a good replacement for this project.

First, Codeception is a completely new testing framework. Although it is based on PHPUnit, it still needs to be installed separately. And some things might not be compatible with PHPUnit.

Also, Cypress is only for Node.js and it only supports Chrome. Not a replacement for good old Selenium and PHPUnit...

luckydonald commented 5 years ago

@filips123 Sounds like some valid points here,

However I'm still very thankful for any good looking alternatives to evaluate, thanks @JaZo.

I'm under the assumption that the fork of @thewunder will be merged into this project at some point, so there will be an upgrade path available in the future?

The composer.json worked, thanks:

    ...
    "repositories": [
        {
            "url": "https://github.com/thewunder/phpunit-selenium.git",
            "type": "git"
        }
    ],
        "require-dev": {
        "phpunit/phpunit-selenium": "dev-phpunit_7_plus",
    },
        ...
thewunder commented 5 years ago

@luckydonald Good to hear. After I do the same with my large test suite and get comparable results I will merge and release this as 7.0

luckydonald commented 5 years ago

@thewunder I see the repo was deleted, can I now just install it like regular, I.e. is it released now?

luckydonald commented 5 years ago

Aaaaaaa installs are breaking

luckydonald commented 5 years ago

apparently no.

I'll try dev-master for now.

luckydonald commented 5 years ago

Okey I can't get it to work. I'll get

 phpunit/phpunit-selenium dev-master requires phpunit/phpunit >=6.0,<7.0 
-> satisfiable by phpunit/phpunit[
6.0.0, 6.0.1, 6.0.10, 6.0.11, 6.0.12, 6.0.13, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6,
6.0.7, 6.0.8, 6.0.9, 6.1.0, 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.2.0, 6.2.1, 6.2.2, 6.2.3,
6.2.4, 6.3.0, 6.3.1, 6.4.0, 6.4.1, 6.4.2, 6.4.3, 6.4.4, 6.5.0, 6.5.1, 6.5.10, 6.5.11,
6.5.12, 6.5.13, 6.5.14, 6.5.2, 6.5.3, 6.5.4, 6.5.5, 6.5.6, 6.5.7, 6.5.8, 6.5.9
] but these conflict with your requirements or minimum-stability.
luckydonald commented 5 years ago

@thewunder What is the current process to install it?

filips123 commented 5 years ago

@luckydonald Paclagist still hasn't updated package. This is probably because they recently removed old github-packagist service which is probably used in this repository. There was a similar issue in hassankhan/config#119.

@thewunder @giorgiosironi One of the maintainers needs to update Packagist to use GitHub's webhook instead of service. See https://github.com/hassankhan/config/issues/119#issuecomment-460052547 for details.

What is the current process to install it?

You have to wait until package is updated.

thewunder commented 5 years ago

@filips123 Yep, although I was given commit rights, I was not made the admin of the repo, so I need @giorgiosironi or possibly even @sebastianbergmann to fix the webhook.

luckydonald commented 5 years ago

I republished the deleted fork with 3129be3c3a90bf46ef301817ea67c2f525451963, so It can at least still be installed for now.

{
        ...
    "license": "Do not use!",
    "repositories": [
        {
            "url": "https://github.com/luckydonald-forks/phpunit-selenium.git",
            "type": "git"
        }
    ],
    "require-dev": {
        "phpunit/phpunit": "^8",
        "phpunit/phpunit-selenium": "dev-phpunit_7_plus",
    }
}

@thewunder please next time wait with deletion until it is released.

Edit: The fork is now a bit newer after the merge in dev, having the added phpunit restriction removed again. As long as you don't need #432, it should be fine.

JaZo commented 5 years ago

@luckydonald, there is no need to keep the fork/branch open once it's merged. Usually dev-master should work but, as @filips123 mentions, the webhook to packagist is currently broken. As a temporary workaround you can define the repository in your composer.json:

{
    "repositories": [{
        "url": "https://github.com/giorgiosironi/phpunit-selenium.git",
        "type": "git"
    }],
    "require-dev": {
        "phpunit/phpunit": "^7",
        "phpunit/phpunit-selenium": "dev-master"
    }
}

Please note that master currently only supports PHPUnit 7!

luckydonald commented 5 years ago

I was not able to get it to work, but I think i removed the "repositories" part as well, I thought that wouldn't be needed as it is the original repo now.

But yeah, that might work as well.

Gonna stick to the fork until a release is live. To make sure it isn't breaking again. Trying to set up unit testing in my company, and if it doesn't install when the boss tries it is kinda a bad first impression lol.

sebastianbergmann commented 5 years ago

I am not the maintainer of https://packagist.org/packages/phpunit/phpunit-selenium.

thewunder commented 5 years ago

I am not the maintainer of https://packagist.org/packages/phpunit/phpunit-selenium.

Thanks for taking the time to let me know I should continue to bother @giorgiosironi I wasn't sure how the whole namespsace owner thing works over at packagist

thewunder commented 5 years ago

7.0.0 is released!

luckydonald commented 5 years ago

:+1: