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

docs: Outline the basic workflow. #2974

Merged
merged 1 commit into from
Apr 23, 2018

Conversation

johnjbarton
Copy link
Contributor

This short narative also helps introduce 'client' and 'context' terminology.

Copy link

@SLaks SLaks left a comment

Choose a reason for hiding this comment

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

Can you talk about middleware?
And /debug.html?


Here is roughly how Karma works:

After starting up, Karma loads plugings and the configuration file, then starts its local web server which listened for connections.
Copy link

Choose a reason for hiding this comment

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

Typos: plugins, listens

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Here is roughly how Karma works:

After starting up, Karma loads plugings and the configuration file, then starts its local web server which listened for connections.
Any browser already watching the web address (localhost:9876 by default) will reconnect immediately. Karma also starts reporters
Copy link

Choose a reason for hiding this comment

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

Can you clarify that "already watching" means (I assume) already have that page loaded from an earlier run?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I think this is base on the websocket from the client page reconnecting. Changed the text.


After starting up, Karma loads plugings and the configuration file, then starts its local web server which listened for connections.
Any browser already watching the web address (localhost:9876 by default) will reconnect immediately. Karma also starts reporters
which register for 'browser' events.
Copy link

Choose a reason for hiding this comment

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

What do you mean?

This sounds like it's saying that it starts those reporters immediately on server startup, whereas I assume you mean that it starts them on (re-)connections.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its part of loading the plugins; clarified.


Once the server sees the websocket connection, it instructs the client -- over the websocket -- to execute tests. The client page opens an iframe with a 'context.html' page from the server. The server generates this context.html page using the configuration. This page includes the test framework adapter, the code to be tested, and the test code.

When the browser loads this context page, the onload event handler connect the context page to the client page via post-message. The framework adapter is in charge at this point: it runs the test, reporting errors or success by messaging through the client page.
Copy link

Choose a reason for hiding this comment

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

Typos: connects, postMessage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

This short narative also helps introduce 'client' and 'context' terminology.
Copy link
Member

@dignifiedquire dignifiedquire left a comment

Choose a reason for hiding this comment

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

great , thank you for writing this

@johnjbarton johnjbarton merged commit 0b2c690 into karma-runner:master Apr 23, 2018
@johnjbarton johnjbarton deleted the workflow branch December 23, 2020 20:13
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.

3 participants