Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 15:20
    marktnoonan synchronize #21598
  • 15:20

    marktnoonan on UNIFY-1566-percy-ci

    add comment for clarity (compare)

  • 15:19

    ryanthemanuel on fix

    Add back ESLintPlugin (compare)

  • 15:08

    mjhenkes on develop

    Trigger Build (compare)

  • 15:07
    cypress[bot] commented #21588
  • 14:51
    marktnoonan edited #21598
  • 14:48
    estrada9166 synchronize #21526
  • 14:48

    estrada9166 on feat

    fix: disable ct testing when ru… Merge branch '10.0-release' int… (compare)

  • 14:46
    MuazOthman review_requested #21536
  • 14:46
    MuazOthman review_requested #21536
  • 14:46
    persianturtle commented #4164
  • 14:45
    MuazOthman commented #21536
  • 14:44
    cypress[bot] commented #21598
  • 14:43
    AtofStryker review_requested #21579
  • 14:41
    cypress-bot[bot] labeled #21583
  • 14:41
    cypress-bot[bot] unlabeled #21583
  • 14:41
    cypress-bot[bot] labeled #21586
  • 14:41
    cypress-bot[bot] unlabeled #21586
  • 14:40
    AtofStryker synchronize #21588
  • 14:40

    AtofStryker on component-testing-options

    fix cypress_spec.js to account … (compare)

Bujor Ovidiu
@16Fed_twitter
image.png
image.png
sorry for double posting the image
unfortunately the html is a bit weird, There is a button wrapper that has a div for the checkmarck icon that also has a text "done"
when I extract the text via invoke it is also extracting the done text for the checked buttons
This is my code
image.png
I use partial id for selector
also I get first the parent div because otherwise it finds buttons from outside the modal
Then I tried to use >not to exclude the div that contains the keyword "done"
but it is not working
I think it is because the text of the buttons is thrown into the wrapper without any div, unlike the checkmark icon that has a div
THis is the html for one of the buttons:
image.png
Bujor Ovidiu
@16Fed_twitter
So, the question is how can I get only the text of the buttons and exclude the text "done" that comes with checked icons
This is what cypress returns for my respective code
image.png
thanks a lot!
Gleb Bahmutov
@bahmutov
Can you copy/paste the HTML markup as text?
@16Fed_twitter
@coltdorsey what does https://on.cypress.io/fixture say? I don't think so
Bujor Ovidiu
@16Fed_twitter
<div _ngcontent-osh-c143="" class="col-3 ng-star-inserted">

<button _ngcontent-osh-c143="" mat-flat-button="" class="mat-focus-indicator mat-tooltip-trigger mktp-columns-panel-textleft mat-flat-button mat-button-base button secondary default" id="ads_campaigns_button_active_products" aria-describedby="cdk-describedby-message-32" cdk-describedby-host="">

<span class="mat-button-wrapper"><mat-icon _ngcontent-osh-c143="" role="img" class="mat-icon notranslate material-icons mat-icon-no-color ng-star-inserted" aria-hidden="true" data-mat-icon-type="font"> done </mat-icon>

<!---->

Active products

</span>

<span matripple="" class="mat-ripple mat-button-ripple"></span>
<span class="mat-button-focus-overlay"></span>
</button>
<!---->
</div>
Gleb Bahmutov
@bahmutov
@16Fed_twitter what are you selecting for? If you are selecting by the button text and want to exclude "done" you can use cy.contains that expects part of the text. If you want to confirm the text for each button, you probably need to remove the "mat-icon" elements first
Gleb Bahmutov
@bahmutov
Bujor Ovidiu
@16Fed_twitter
I need to use the texts to extract substrings that cypress will use later in the search field, the problem is >not is not helping me, it still returns the "done" word
Bujor Ovidiu
@16Fed_twitter
I think the only way to do it will be to click all the buttons that contain "done", then extract the string, it's not working otherwise
Richard Forjoe
@rforjoe_twitter
Hi @bahmutov this might be a silly question but wondering about this. What is the difference between a normal npm package and a cypress plugin? Do you have an example basic cypress plugin? is it just a package.json file and an index.js file with the functions in them? Basically trying to create a shared plugin with some functions and custom commands anyone can import. Thank you
Gleb Bahmutov
@bahmutov
@16Fed_twitter no, see my commit. I am now thinking one can grab all children elements, and just get the text nodes, that should be the own text content without children elements..
@rforjoe_twitter yup, it is just NPM package to distribute and install it. read https://glebbahmutov.com/blog/publishing-cypress-command/
1 reply
Galea Olimpiu
@olimpiu-galea
Hello, I'm trying to send a cy. request with a POST method for an API that requires to upload an image and this is not working, any suggestions ? cy.fixture('imagePath.jpg').then((image) =>
{
cy.request({
method: 'POST',
url: 'url',
Headers: [{ "key": "Accept", "value": "/", "description": "",'Content-Type': 'application/json', "enabled": true }],
body: image
        }).as('apiCall')
    })
Colt Dorsey
@coltdorsey
@bahmutov I looked at the cy.fixture documentation before asking, but also didn't see anything. I decided to ask you anyway incase you had some ninja wizardry ideas. I ended up programmatically getting an array of filenames in the fixtures/random directory (via plugins/index js) and storing the array as a cypress env variable. In the test, im looping through the array and passing the filename string to cy.fixture.
Gleb Bahmutov
@bahmutov
@coltdorsey That's a good approach
Bujor Ovidiu
@16Fed_twitter
@bahmutov thanks a lot
Galea Olimpiu
@olimpiu-galea
Hello, how could I attach a image .jpg to a request over a post method ? I tried taking it from fixture as it is but it's not working. cy.fixture('rub-z-data-image/ms_1a26dd665a814149984040f0f116aa00.jpg').then((image) =>
{
cy.request({
method: 'POST',
url: 'API',
body: image
        }).as('apiCall') 
Matt Marsh
@marshmn

@bahmutov : do you have any video/blog on techniques for comparing screenshots (e.g using https://github.com/meinaart/cypress-plugin-snapshots or similar)?

(I've been looking on your blog but not found anything yet...)

My use case is wanting to check output drawn to a canvas (using Phaser JS)

Gleb Bahmutov
@bahmutov
Screen Shot 2022-05-22 at 12.03.31.png
@marshmn if you search https://cypress.tips/search for "canvas" you would find it
@olimpiu-galea how do you receive the image on the backend?
Galea Olimpiu
@olimpiu-galea
@bahmutov solved. It worked with blob, form data.set() in the end
Matt Marsh
@marshmn
@bahmutov : ah cool, got it - thanks
I knew you'd have something in there somewhere :-)
kshastri
@kshastri
Im new to Cypress and would like to try my hands. Is cypress-io/cypress#19098 a good issue to pick?
If not kindly suggest a good first issue for me to work upon. I have just checked out the Cypress code
Uzaeir
@UzaeirKhan
Hi
I'm using cypress along with cucumber plugin. After setting up reporting part, I found out one issue. When I bundled the scenarios it did not detect failing scenarios which comes first for e.g.
feature ---> test 1 , test 2 ...
If for some reason test 1 fails it did not show in the report. Whereas if test 2 fails its shows the failing test in the report.
I'm using following versions:
cypress ---> 9.6.0
cypress-cucumber-preprocessor ---> 4.3.1
Jonas Amundsen
@badeball
TLDR: update your dependency
kbmail
@kbmail1_twitter
Hi, I am new to cypress. I have written test (.js) file with multiple it() methods. I am seeing weired behavior when I try to run the suite. My applic logs out for each it() call. I have no hooks written in the test. Can someone provide me solution plz.
srabich-makor
@srabich-makor
what's approach is better and recommended: testing the app via public URL or taking a clone of the project client and building above him cypress ...? thanks
mhawkins8811
@mhawkins8811
When running a testing against a remix/typescript application, in the cypress browser it is disabling javascript thus leaving the application in a bad state, would someone know why? Reduced the cypress test to basic commands
richardszanyi-kasa
@richardszanyi-kasa

Greetings,

I would like to ask whether someone has experience with the following scenario:
From a repo github action checks out and sync feature files into xray cloud. Then GHA checks out the synced feature files, and it runs cypress against it with the "spec: " flag there and in the end it syncs in to the cypress dashboard.
As far as I can see the syncing part works fine, but as soon as it gets to the github action which runs the cypress feature file - the dashboard registers it (as in the run shows up there) but it says 1 of 2 specs is running. However, only one feature file is merged together in the pipeline. Also, after the first Scenario fails in the feature file, the whole test just skips, and I also have the "continue-on-error: true" flag in the gha settings.
Please do let me know if anyone has any experience working such configuration or environment. ^^ Thanks!