Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(testcafe): viewer public drive #1507

Merged
merged 7 commits into from Apr 1, 2019

Conversation

CozyKourai
Copy link
Contributor

  • new folder drive-vr containing page model, to use with visual testing :
    Some test function were modified to fit with visual review, and I didn't want to check the old tests which don't use Visual Review. In the future(?) all page model should move to drive-vr or photos-vr when all tests use Visual Review

  • also all methods which take a screenshot are now named method_vr()

@cozy-bot
Copy link

Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 1- Prepare Data : https://visualreview.cozycloud.cc/#/31/54/680
  • ❌ drive : PublicViewerFeature 2- Go to public link and download files : https://visualreview.cozycloud.cc/#/31/55/681
  • ❌ drive : PublicViewerFeature 3- Cleanup Data : https://visualreview.cozycloud.cc/#/31/56/682
  • @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ undefined : fixture : upload photos : https://visualreview.cozycloud.cc/#/32/57/683
  • ❌ undefined : fixture : delete photos : https://visualreview.cozycloud.cc/#/32/58/684
  • @CozyKourai CozyKourai force-pushed the testcafe/drive_public_viewer branch 2 times, most recently from a32e0e6 to c15c4c4 Compare March 20, 2019 13:58
    @cozy cozy deleted a comment from cozy-bot Mar 20, 2019
    @cozy cozy deleted a comment from cozy-bot Mar 20, 2019
    @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 1- Prepare Data : https://visualreview.cozycloud.cc/#/31/54/708
  • ❌ drive : PublicViewerFeature 2- Go to public link and download files : https://visualreview.cozycloud.cc/#/31/55/709
  • @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ photos : fixture : upload photos : https://visualreview.cozycloud.cc/#/34/61/712
  • @cozy cozy deleted a comment from cozy-bot Mar 20, 2019
    @cozy cozy deleted a comment from cozy-bot Mar 20, 2019
    @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 1- Prepare Data : https://visualreview.cozycloud.cc/#/31/54/760
  • ❌ drive : PublicViewerFeature 2- Go to public link and download files : https://visualreview.cozycloud.cc/#/31/55/761
  • ❌ drive : PublicViewerFeature 3- Cleanup Data : https://visualreview.cozycloud.cc/#/31/56/762
  • @cozy cozy deleted a comment from cozy-bot Mar 21, 2019
    @cozy cozy deleted a comment from cozy-bot Mar 21, 2019
    @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 1- Prepare Data : https://visualreview.cozycloud.cc/#/31/54/780
  • ❌ drive : PublicViewerFeature 2- Go to public link and download files : https://visualreview.cozycloud.cc/#/31/55/781
  • @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 1- Prepare Data : https://visualreview.cozycloud.cc/#/31/54/789
  • ❌ drive : PublicViewerFeature 2- Go to public link and download files : https://visualreview.cozycloud.cc/#/31/55/791
  • @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 1- Prepare Data : https://visualreview.cozycloud.cc/#/31/54/804
  • ❌ drive : PublicViewerFeature 2- Go to public link and download files : https://visualreview.cozycloud.cc/#/31/55/805
  • @CozyKourai
    Copy link
    Contributor Author

    @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 2- Go to public link and download files : https://visualreview.cozycloud.cc/#/31/55/828
  • @CozyKourai CozyKourai force-pushed the testcafe/drive_public_viewer branch 3 times, most recently from 8eaf3e3 to 2fc0cda Compare March 22, 2019 09:47
    @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 1- Prepare Data : https://visualreview.cozycloud.cc/#/31/54/911
  • ❌ drive : PublicViewerFeature 2- Go to public link and download files : https://visualreview.cozycloud.cc/#/31/55/913
  • ❌ drive : PublicViewerFeature 3- Cleanup Data : https://visualreview.cozycloud.cc/#/31/56/914
  • testcafe/tests/pages/drive-model-public.js Outdated Show resolved Hide resolved

    await this.waitForLoading()
    console.log(`Navigation into ${folderName} OK!`)
    }
    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Je serais plus pour diviser la méthode côté page-drive en 2. Car en soit, le goToFolder n'a pas à vérifier le breadcrumb... Le découpage des responsabilités est important

    (à faire dans une autre PR, mais je note ça là quand même)

    new RegExp('([' + numOfFiles + '].*){2}'),
    'Numbers of files uploaded does not match'
    )
    }
    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Idem découpler dans la page drive le fait de prendre le screenshot et le expect sur les nombres de fichier.

    Par contre, je comprends pas ici pourquoi on fait tout ça ? On a juste besoin d'uploader les fichiers et faire un screenshot à la fin ? Pourquoi vérifier le contenu des H4 des modales etc ?

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Ces fonctions (Vérifier les modales, etc...) etaient deja en place avant l'ajout de VR, et je ne les ai pas enlevé pour pouvoir prendre le screenshot au bon moment.
    Notament quand j'upload 25 fichiers à la suite : remplacer ces checks par un wait me semble plus propice à des erreurs
    Par contre, c'est vrai que le execpt sur le texte peut etre retiré!

    async goToFolder(folderName) {
    await t
    .expect(this.folderOrFileName.withText(folderName).exists)
    .ok(`No folder named ${folderName}`)
    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    On n'a pas besoin de ce expect, non ?

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Ca reste dans les bonnes pratiques de testcafe de verifier l'existance d'un composant avant de l'utiliser (ici pour cliquer dessus)

    @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 1- Prepare Data : https://visualreview.cozycloud.cc/#/31/54/920
  • ❌ drive : PublicViewerFeature 2- Go to public link and download files : https://visualreview.cozycloud.cc/#/31/55/921
  • ❌ drive : PublicViewerFeature 3- Cleanup Data : https://visualreview.cozycloud.cc/#/31/56/922
  • Copy link
    Contributor

    @Crash-- Crash-- left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Ping moi quand t'es dispo, je pense qu'il y a beaucoup de taff à faire sur cette PR encore :/

    @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 1- Prepare Data : https://visualreview.cozycloud.cc/#/31/54/1173
  • Copy link
    Contributor

    @y-lohse y-lohse left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Thanks! I think overall the changes look good, but there are some small problems.

    testcafe/runner-drive.js Outdated Show resolved Hide resolved
    testcafe/tests/drive/navigation.js Outdated Show resolved Hide resolved
    testcafe/tests/drive/public-viewer-feature.js Outdated Show resolved Hide resolved
    testcafe/tests/drive/public-viewer-feature.js Outdated Show resolved Hide resolved
    testcafe/tests/drive/public-viewer-feature.js Outdated Show resolved Hide resolved
    testcafe/tests/pages/drive-viewer/drive-viewer-model.js Outdated Show resolved Hide resolved
    testcafe/tests/pages/drive-viewer/drive-viewer-model.js Outdated Show resolved Hide resolved
    testcafe/tests/pages/drive/drive-model-private.js Outdated Show resolved Hide resolved
    ///there is no photos on page
    await page.initPhotoCountZero()
    await page.uploadPhotos([`${DATA_PATH}/${IMG0}`])

    await t.fixtureCtx.vr.takeScreenshotAndUpload('Upload-1-pic.png')
    await t.fixtureCtx.vr.takeScreenshotAndUpload('UploadImage/Upload-1-pic.png')
    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    How comes sometimes we do if (t.fixtureCtx.isVR) before taking a screenshot, and sometimes not?

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    if (t.fixtureCtx.isVR)is use in methods that were written before using VisualReview, so we don't have to duplicate them (ie : UploadFiles is used in several tests : some already using VisualReview, and older tests which don't have screenshot yet, so we need a condition to know when to take screenshots)

    Here, in photos_start_upload_photos.js we are in a test using VisualReview (as we do await initVR(..) in .before so we don't need to check the condition

    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Ok I see, temporary code then. Thanks for the explanation!

    @y-lohse
    Copy link
    Contributor

    y-lohse commented Mar 28, 2019

    Just a side-question: why are the files in /pages called model?

    @CozyKourai
    Copy link
    Contributor Author

    CozyKourai commented Mar 28, 2019

    Just a side-question: why are the files in /pages called model?

    Testcafe vocabulary (but we can change the name if we prefer)
    https://devexpress.github.io/testcafe/documentation/recipes/use-page-model.html

    @y-lohse
    Copy link
    Contributor

    y-lohse commented Mar 28, 2019

    Testcafe vocabulary (but we can change the name if we prefer)

    Thanks! I now realize I may have asked this before :'). It's really confusing to me but if it's a convention I'm happy to keep it. Just might ask the same question in 3 month 😁

    @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 2- Go to public link and download files : https://visualreview.cozycloud.cc/#/31/55/1321
  • @CozyKourai CozyKourai force-pushed the testcafe/drive_public_viewer branch 2 times, most recently from a8ae69c to 52b9f9d Compare March 29, 2019 08:46
    @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 1- Prepare Data : https://visualreview.cozycloud.cc/#/31/54/1351
  • ❌ drive : PublicViewerFeature 3- Cleanup Data : https://visualreview.cozycloud.cc/#/31/56/1352
  • @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 2- Go to public link and download files : https://visualreview.cozycloud.cc/#/31/55/1361
  • @cozy cozy deleted a comment from cozy-bot Mar 29, 2019
    @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 2- Go to public link and download files : https://visualreview.cozycloud.cc/#/31/55/1380
  • @cozy-bot
    Copy link

    Visual Review - Please review screenshots, then restart build.

  • ❌ drive : PublicViewerFeature 2- Go to public link and download files : https://visualreview.cozycloud.cc/#/31/55/1406
  • Copy link
    Contributor

    @y-lohse y-lohse left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Thanks, LGTM!

    @CozyKourai CozyKourai merged commit df0b6e9 into master Apr 1, 2019
    @CozyKourai CozyKourai deleted the testcafe/drive_public_viewer branch April 1, 2019 06:53
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    None yet

    4 participants