wswebcreation / protractor-image-comparison

npm-module to compare images with protractor
86 stars 38 forks source link

chore: improve dev environment #113

Closed ennjin closed 4 years ago

ennjin commented 5 years ago

It's just suggestion for improve dev environment.

Completed:

  1. Tslint is deprecated. Using eslint instead.
  2. Add packge-lock file to git (https://stackoverflow.com/a/44210813)
  3. Prettify code style
  4. Imporve tsconfig.json
  5. Get rid of unused dependecies and update current.

What will need to do

  1. Refactoring of e2e tests. I haven't time to do it right now, but I can do it later or someone else can join

It's just suggestion. You can just close this PR if you don't wanna delve into this, it's OK!

ennjin commented 5 years ago

Just one question, what did you have in mind for the tests?

IMHO, there is copypasta and conflicts with linter. Also, the folder structure looks unclearly.

Can you also fix the merge conflict?

Sure, no problem

wswebcreation commented 5 years ago

IMHO, there is copypasta and conflicts with linter. Also, the folder structure looks unclear, but it's minor things.

Can you explain a little bit more about what's not clear about the folder structure? By the way, I'm now adding iOS 13 images, running the tests and release a new version

ennjin commented 5 years ago

Can you explain a little bit more about what's not clear about the folder structure?

I think, we should improve like this

test/
  **.spec.ts
  test-setup.ts
  configs/
   **.config.js
images/
  sauseLabs/
    baseline/
      browser_version/
        **.png
     actual/
       browser_version/
         **.png
     diff/
       browser_version/
         **.png
  local
    baseline/
      browser_version/
        **.png
     actual/
       browser_version/
         **.png
     diff/
       browser_version/
         **.png

By the way, I'm now adding iOS 13 images, running the tests and release a new version

It's cool! Because this PR still work in progress and doesn't ready to be merged.

wswebcreation commented 5 years ago

I think, we should improve like this

test/
  **.spec.ts
  test-setup.ts
  configs/
   **.config.js
images/
  sauseLabs/
    baseline/
      browser_version/
        **.png
     actual/
       browser_version/
         **.png
     diff/
       browser_version/
         **.png
  local
    baseline/
      browser_version/
        **.png
     actual/
       browser_version/
         **.png
     diff/
       browser_version/
         **.png

The reason for having this structure has to do with the following:

What are your reasons/thoughts for wanting to change them?

ennjin commented 5 years ago

the local baseline folder should never be pushed, this is for local testing only and can differ per machine

We can easily add it to .gitignore file, the same for actual and diff

What are your reasons/thoughts for wanting to change them?

It's just point of my view :) I think it's looks logical. What do you think about it?

wswebcreation commented 5 years ago

the local baseline folder should never be pushed, this is for local testing only and can differ per machine

We can easily add it to .gitignore file, the same for actual and diff

What are your reasons/thoughts for wanting to change them?

It's just point of my view :) I think it's looks logical. What do you think about it?

That's true, then there should be a cleaning script before the instances start to clean the actual|diff folders, now it's pretty easy to do that by removing the .tmp/ folder.

I would still prefer the images to be in the test folder because it's part of the tests. For the rest I would say "Go with the flow, when you have time 😉 "

ennjin commented 5 years ago

Hey, @wswebcreation, I'm done with this PR.

The changes:

  1. Update structure of test folder

  2. Get rid of redundant e2e tests ( I think it should be simple, like KISS ) If library can compare images without errors then it work correctly and we don't need to check path or do complex stuff

  3. Now, all baselines saving into images folder. Actual and diff folders automatically removed before run.

I checked and created baselines only for desktop chrome browser. It will be nice if you run it in saucelabs and push new images into my branch.

From my point of view, now it's look neatly :)

ennjin commented 5 years ago

Small note:

If needed to cover libraries methods you should create unit test instead of e2e. Also, I think, it should be in webdriver-image-comparison package.

wswebcreation commented 5 years ago

Thanks for all the work, I'll take a look at it and recreate a baseline the coming days. It will take me some time.

ennjin commented 4 years ago

Updated! Please, ckeck it.

wswebcreation commented 4 years ago

Thanks for the hard work @vitalie-ly , going to release a new version today

ennjin commented 4 years ago

Cool :) I think version should be 3.8.1 because there isn't major changes. Anyway, thanks for you work too.

wswebcreation commented 4 years ago

Changing some small things and hope to do a release in a few minutes