The invitation
IRCC sends the invitation by email, as a PDF, after you submit your application. Most people get it 1 to 3 months after they receive the acknowledgment of receipt of their application (AOR); a non-routine application can take longer. You can't book the test yourself or ask for an invitation.
The invitation has a test start date and end date (30 days), a link to the test, your application number and your unique client identifier (UCI). It usually arrives at least 2 to 3 business days before the start date; look for an address ending in @cic.gc.ca or @canada.ca, and check your junk folder.
The 30 days and your 3 chances
You can take the test any time in the 30 days, weekends and holidays included, and you have up to 3 chances to pass in that period: if you fail, sign in and try again. You can't sign in before or after the window. If you miss your first invitation, IRCC sends a new one; if you miss a second without contacting IRCC, it may stop processing your application.
To reschedule, email the address in the rescheduling section of your invitation; IRCC says it usually takes 4 to 8 weeks.
On the day
Sign in with your application number and UCI, ask for the test link by email (it expires after 15 minutes), confirm your identity and take photos of your ID and yourself. Use a computer or tablet with a webcam and Chrome or Safari, not a phone. You don't need to be in Canada.
The 45-minute timer can't be stopped, and the test is submitted automatically at the end. Don't use other devices, study materials or the browser's back button: the webcam takes random photos, and signs of cheating can make the result invalid.
Your results
When you submit online, the result page shows your score at once. It is unofficial: print it or email it to yourself, as you can't sign in to see it again. An officer then reviews it to make it official, which can take a few days or weeks. The official result is a pass (at least 15 of 20), a fail (all your attempts in the 30 days failed) or invalidated.
After a pass, IRCC may invite you to an interview and invites you to the citizenship ceremony. If you fail all 3 attempts, it invites you to a hearing with a citizenship official, who may ask 20 knowledge questions orally (15 to pass) and assess your English or French. If you fail the hearing, IRCC refuses the application.