Skip to content

Page hangs during in Facebook window after clicking 'Post' #4629

@rob4629

Description

@rob4629

What is your Test Scenario?

I'm trying to create a petition on change.org, and share it to Facebook.

What is the Current behavior?

I'm able to log in to Facebook and initiate the Share, however the page hangs after clicking 'Post' in Facebook. The same thing happens if I also choose 'Cancel'.
I'm unable to manually test this in the TestCafe browser due to this issue.

What is the Expected behavior?

Expected behaviour would be for the page to re-direct when either clicking 'Cancel' or 'Post'

What is your web application and your TestCafe test code?

Your website URL (or attach your complete example):
www.change.org

Your complete test code (or attach your test files):
const firstNameInput = Selector('[name="firstName"], [name="first_name"]').filterVisible();
const lastNameInput = Selector('[name="lastName"], [name="last_name"]').filterVisible();
const emailInput = Selector('.js-email-sign, input[name="email"]').filterVisible();
const petitionAddress = '/p/united-nations-send-matt-damon-to-mars-to-retrieve-opportunity';

fixture('Share Petition to Facebook').page('https://www.change.org');

 test.('Guest user should see facebook when sharing a petition', async () => {
  await t.navigateTo(petitionAddress);
  await t
      .typeText(firstNameInput, "Some")
      .typeText(lastNameInput, "Name")
      .typeText(emailInput, "email@email.com")
      .click(Selector('button[type="submit"]'))
      .click(Selector('.js-skip'));
  
// initiate share:
  await t
      .click(Selector('.js-facebook-share-dialog'))
      .typeText(Selector('[id="email"]'), "your.email")
      .typeText(Selector('[id="pass"]'), "your.password")
      .click(Selector('[name="login"]'));

// Write message and share
await t
      .typeText(Selector('.mentionsTextarea'), "Random Text")
      .click(Selector('[name="__CONFIRM__"]'));

// Check Page is returned to change.org
await t.expect(getCurrentUrl()).contains(`change.org/${petitionAddress}`);
});
As mentioned, when clicking either 'Cancel' or 'Post' (/'Confirm'), the page hangs in the Facebook post window.
Your complete configuration file (if any):
{
  "browsers": ["chrome", "firefox"],
  "src": "./tests/**/*.js",

  "assertionTimeout": 10000,
  "pageLoadTimeout": 30000,
  "selectorTimeout": 10000,

  "quarantineMode": false,
  "skipJsErrors": true,

  "disablePageCaching": true,

  "reporter": [
    {
      "name": "xunit",
      "output": "artifacts/test-results/results.xml"
    },
    {
      "name": "spec"
    }
  ],

  "screenshots": {
    "fullPage": true,
    "takeOnFails": true,
    "pathPattern": "${TEST_ID}/${RUN_ID}_${FILE_INDEX}.png",
    "path": "artifacts/screenshots"
  },

  "videoOptions": {
    "singleFile": false,
    "failedOnly": true,
    "pathPattern": "${TEST_INDEX}/${RUN_ID}_${FILE_INDEX}.mp4"
  },
  "videoPath": "artifacts/recordings"
}

Your complete test report:
 1) AssertionError: expected

   'https://www.facebook.com/v3.2/dialog/share?channel=https%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D45%23cb%3Df25a0076a291eac%26domain%3Dwww.change.org%26origin%3Dhttps%253A%252F%252Fwww.change.org%2<BLAH>'
      to include 'change.org/p/united-nations-send-matt-damon-to-mars-to-retrieve-opportunity'

      Browser: Chrome 79.0.3945.117 / macOS 10.15.2
      Screenshot: <PATH>/screenshots/test-1/_errors/1.png

         37 |  await createPetitionAndShareToFacebook(user);
         38 |
         39 |  await facebookShare.loginToFacebook();
         40 |  await facebookShare.verifyFacebookSharePage();
         41 |  await facebookShare.cancelShare();
       > 42 |  await t.expect(getCurrentUrl()).contains(`change.org/p/${t.ctx.petition.slug}`);
         43 |});
         44 |

         at <anonymous> (<PATH>/petitions/share/guest_share.js:42:35)

 1/1 failed (57s)
Screenshots:
![Screenshot 2020-01-09 at 4 39 31 PM](https://user-images.githubusercontent.com/37812673/72118564-53626880-3306-11ea-8978-a239d2fa8bb0.png)

Steps to Reproduce:

  1. Go to my website ...
  2. Execute this command...
  3. See the error...

Your Environment details:

  • testcafe version: 1.7.0
  • node.js version: 10.15.3
  • command-line arguments: testcafe chrome share.js
  • browser name and version: chrome 79.0.3945.117
  • platform and version: MacOs Catalina 10.15.2
  • other:

Metadata

Metadata

Assignees

No one assigned

    Labels

    STATE: Auto-lockedAn issue has been automatically locked by the Lock bot.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions