Skip to content

Commit

Permalink
Baseline Cypress test created but input not appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
Snafkin547 committed Apr 12, 2024
1 parent bdfb56e commit 43d2c9a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 39 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/array-binary-search/client.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1>Connect JIFF</h1>
<button id="connectButton" onclick="connect();">Connect</button>
<br/><br/>
<hr/>
<div class="container" id="input1" style="display: none">
<div class="container" id="input1" style="display: block">
<div class="row">
<h1>Input Sorted Array</h1>
</div>
Expand All @@ -43,7 +43,7 @@ <h1>Input Sorted Array</h1>
</div>
</div>

<div class="container" id="input2" style="display: none">
<div class="container" id="input2" style="display: block">
<div class="row">
<h1>Input Search Element.</h1>
</div>
Expand Down
15 changes: 7 additions & 8 deletions cypress/e2e/array-binary-search/test.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,19 @@ describe('Array Binary Search', () => {
// Ensure the correct role is selected and the inputs are visible
cy.get('#role').select('Provide Array');
cy.get('#connectButton').click();
cy.get('#input1').should('be.visible');

// Input the array
cy.get('#inputArray').clear().type(JSON.stringify(arrayInput));
cy.get('#submit1').click();
cy.wait(500);

// The second submitter provides an element to search
cy.visit('./cypress/e2e/array-binary-search/client.html');
cy.get('#role').select('Provide element to search');
cy.get('#connectButton').click();
cy.get('#input2').should('be.visible');

// Input the element to be searched
// Input the array by contributor 1
cy.get('#input1').should('be.visible');
cy.get('#inputArray').clear().type(JSON.stringify(arrayInput));
cy.get('#submit1').click();

// Input the element to be searched by contributor 2
cy.get('#input2').should('be.visible');
cy.get('#inputElement').clear().type(`${elementInput}`);
cy.get('#submit2').click();

Expand Down
28 changes: 0 additions & 28 deletions cypress/support/mpc.ts

This file was deleted.

2 changes: 1 addition & 1 deletion cypress/support/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let JIFFServer = require('../../lib/jiff-server');
let jiff_instance = new JIFFServer(http, { logs: true });

// Serve static files.
app.use('/demos', express.static(path.join(__dirname, '..', '..', 'demos')));
app.use('/cypress', express.static(path.join(__dirname, '..', '..', 'cypress')));
app.use('/dist', express.static(path.join(__dirname, '..', '..', 'dist')));
app.use('/lib/ext', express.static(path.join(__dirname, '..', '..', 'lib', 'ext')));

Expand Down

0 comments on commit 43d2c9a

Please sign in to comment.