Skip to content

Add Selenium tests to continuous integration #89

@RedDragonWebDesign

Description

@RedDragonWebDesign

There is a ton of technical debt in this legacy code. Enough to keep a full time dev busy for a year upgrading everything.

I pretty much have no time to dedicate to this, which is why the repo has been inactive. There is very little public interest in this repo either, with only 9 stars and like 1 ticket/PR a year.

I think the place to start is to set up some automated tests that test against each PHP version. Then work from the bottom up fixing things broken in each version. So first PHP 7.0, then PHP 7.1, etc. Until the scripts run with no feature breakage and no fatal errors on the current PHP version, PHP 8.3.

Each PHP version should be paired with a version of MySQL that was typical for usage with that PHP version. Since MySQL versions can also cause breaking changes.

  • 2015 / PHP 7.0 / MySQL 5.7
  • 2016 / PHP 7.1 / MySQL 5.7
  • 2017 / PHP 7.2 / MySQL 5.7
  • 2018 / PHP 7.3 / MySQL 8.0
  • 2019 / PHP 7.4 / MySQL 8.0
  • 2020 / PHP 8.0 / MySQL 8.0
  • 2021 / PHP 8.1 / MySQL 8.0
  • 2022 / PHP 8.2 / MySQL 8.0
  • 2023 / PHP 8.3 / MySQL 8.3

Now, what kind of tests? I'm not going to write proper unit and integration tests for this repo. That'd be too much work. We need something that can be set up quickly and detect broad changes. In my opinion, the options are...

  • Selenium tests - a type of testing where you program a browser to click around, and assert that certain strings and elements are found. a lot of work to write though, and can be flaky
  • pixel tests - a type of testing that takes a screenshot of pages and looks for any visual differences
  • HTML snapshot tests - wrap all the entry point files in a function that outputs an HTML string, then call that function in the entry points and in tests. record what strings are "normally" output, and compare those against what is currently output after making code changes

I think trying to fix every deprecation, notice, and warning would be too much work as well. So we should set the test's error reporting to only report errors. We can put off fixing deprecations until the syntax is actually deprecated and causes a breakage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions