Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion final/client/src/pages/cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Cart: React.FC<CartProps> = () => {
<Fragment>
<Header>My Cart</Header>
{data?.cartItems.length === 0 ? (
<p data-testid="empty-message">No items in your cart</p>
<p id="empty-cart" data-testid="empty-message">No items in your cart</p>
) : (
<Fragment>
{data?.cartItems.map((launchId: any) => (
Expand Down
7 changes: 7 additions & 0 deletions final/node_testing/auth_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ async function runTests(){
await loginTest();
await userVerificationTest();
await navigateToCart();
await verifiesCartIEempty();
await userVerificationTest();
await naviageToProfile();
await naviageToHome();
Expand Down Expand Up @@ -88,6 +89,12 @@ async function addStarlinkToCart() {
console.log('Pass: 1 item added to the cart');
}

async function verifiesCartIEempty() {
var message = await driver.findElement(By.id('empty-cart')).getText();
assert.equal(message, 'No items in your cart');
console.log('Pass: No item added in the cart');
}

async function verifystartLinkAddedInTheCart() {
await driver.wait(until.elementLocated(By.id('109')), 5000).then(async() => {
var url = await driver.findElement(By.id('109')).getAttribute('href');
Expand Down