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

Error in Quality Assurance Course - suiteSetup Hook #54550

Closed
darkpsinight opened this issue Apr 26, 2024 · 2 comments
Closed

Error in Quality Assurance Course - suiteSetup Hook #54550

darkpsinight opened this issue Apr 26, 2024 · 2 comments
Labels
scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.

Comments

@darkpsinight
Copy link

Describe the Issue

There seems to be a small error in the FreeCodeCamp Quality Assurance course regarding the usage of the suiteSetup hook. In the lesson about simulating actions using a headless browser (Course), there's a code snippet provided:

suiteSetup(function(done) {
  return browser.visit('/', done);
});

However, it appears that there's a mistake in this code. The done function should be called with parentheses, like this:

suiteSetup(function(done) {
  return browser.visit('/', done());
});

By adding parentheses after done , we ensure that done is actually invoked as a function, signaling the completion of the setup. Without the parentheses, done is passed as a callback function, which could lead to unexpected behavior.

Update: The solution to this issue has been found in the forum discussion at this link: (FCC Forum).

Looking forward to hearing your insights!

Affected Page

https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-and-testing-with-chai/simulate-actions-using-a-headless-browser

Your code

suiteSetup(function(done) {
  return browser.visit('/', done);
});

Expected behavior

suiteSetup(function(done) {
  return browser.visit('/', done());
});

Screenshots

No response

System

  • Device: [PC]
  • OS: [Windows11]
  • Browser: [Chrome]
  • Version: [124.0.6367.78]

Additional context

No response

@darkpsinight darkpsinight added scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc. labels Apr 26, 2024
@gikf
Copy link
Member

gikf commented Apr 27, 2024

From my understanding the browser.visit uses the callback function once visit is completed. In here indicating completion of the setup at that point.

Otherwise, calling done() earlier would not mean that setup is completed.

@ShaunSHamilton
Copy link
Member

Hello there,

I cannot reproduce any issue with the lesson. Also, as mentioned, done is a callback function that is supposed to be called by browser.visit - it should not be called beforehand.

You can see this in Zombie's docs: https://zombie.js.org/

As such, I am going to close this issue for now.

@ShaunSHamilton ShaunSHamilton closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.
Projects
None yet
Development

No branches or pull requests

3 participants