Skip to content

Commit

Permalink
add bonus 51
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Jun 22, 2023
1 parent 7a82fed commit f486a62
Show file tree
Hide file tree
Showing 5 changed files with 540 additions and 30 deletions.
13 changes: 13 additions & 0 deletions 2nd/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html>
<head>
<style>
.won {
font-weight: bold;
}
</style>
</head>
<body>
<h2>Random drawing</h2>
<p>Lucky winner gets <span class="won">Sauce Labs Backpack</span></p>
</body>
</html>
28 changes: 0 additions & 28 deletions cypress/e2e/inventory/breadcrumbs.cy.ts

This file was deleted.

25 changes: 25 additions & 0 deletions cypress/e2e/misc/two-domains.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { LoginPage } from '@support/pages/login.page'
import { LoginInfo } from '..'

// make sure to start the second server
// using "npm run start:2nd" NPM alias
// It should host a page at "localhost:5555"
// with the name of the item the user won
it('gets the item name from another domain', () => {
// switch to the 2nd domain "http://localhost:555"
// https://on.cypress.io/origin
// visit the base page of the second domain
// https://on.cypress.io/visit
// get the winning item name
// and yield it from the callback function
//
// get the subject string yielded by the cy.origin command
// and print it to the Command Log
// https://on.cypress.io/log
// log in using the LoginPage method
// visit the inventory page
// and confirm it contains the winning item by name
// scroll the winning item into the current viewport
// https://on.cypress.io/scrollintoview
// Bonus: highlight the winning item by giving it a magenta border
})
Loading

0 comments on commit f486a62

Please sign in to comment.