Open Bug 1755159 Opened 2 years ago Updated 2 years ago

Document how to use `add_setup` in tests

Categories

(Testing :: Mochitest, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: mathew.hodson, Unassigned)

References

Details

The new add_setup method and the proper way to use it should be documented somewhere on https://firefox-source-docs.mozilla.org/.

I see this page https://firefox-source-docs.mozilla.org/testing/xpcshell/index.html

That documents add_task and registerCleanupFunction, but it's specifcally about xpcshell tests. Can the the new add_setup be used in xpcshell tests?

(In reply to Mathew Hodson from comment #1)

I see this page https://firefox-source-docs.mozilla.org/testing/xpcshell/index.html

That documents add_task and registerCleanupFunction, but it's specifcally about xpcshell tests. Can the the new add_setup be used in xpcshell tests?

No, it is specific to browser chrome tests, at least right now - sadly all our frameworks (mochitest plain, browser and xpcshell) have their own add_task implementation (and would need their own add_setup implementation). As far as I know the main mochitest/browser documentation that used to exist on MDN is still not migrated to fx-source-docs, and I think doing that is probably more pressing than documenting add_setup.

Depends on: 1757040

(In reply to :Gijs (he/him) from comment #2)
As far as I know the main mochitest/browser documentation that used to exist on MDN is still not migrated to fx-source-docs, and I think doing that is probably more pressing than documenting add_setup.

See bug 1740033. The old mochitest docs are in the MDN archive

Depends on: 1740033
Depends on: 1763980
No longer depends on: 1740033
You need to log in before you can comment on or make changes to this bug.