This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests to verify command and beacon counts (#45)
- Loading branch information
1 parent
cf217c2
commit caa1009
Showing
23 changed files
with
450 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
139 changes: 139 additions & 0 deletions
139
applications/redeye-e2e/src/integration/e2e/beacon-count.skip.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
/// <reference types="cypress" /> | ||
|
||
// PENDING BUG FIX FOR FIRST 2 TESTS BELOW | ||
|
||
describe('Beacon counts', () => { | ||
const camp = 'beaconcounts'; | ||
const fileName = 'gt.redeye'; | ||
|
||
it('Verify beacon counts on campaign card against counts on Hosts tab of campaign', () => { | ||
cy.uploadCampaign(camp, fileName); | ||
cy.searchForCampaign(camp); | ||
|
||
// Log starting number of campaign comments on campaign card | ||
cy.get('[cy-test=beacon-count]').then((number1) => { | ||
const beaconTotal = number1.text().split(' ').shift(); | ||
cy.get('[cy-test=beacon-count]').should('contain', beaconTotal); | ||
|
||
// Open campaign and add up counts of beacons by host - should equal number showing on campaign | ||
cy.selectCampaign(camp); | ||
cy | ||
.get('[cy-test=row-beacon-count]') | ||
.eq(0) | ||
.invoke('text') | ||
.then((countRow1) => { | ||
// cy.log(countRow1); | ||
|
||
cy | ||
.get('[cy-test=row-beacon-count]') | ||
.eq(1) | ||
.invoke('text') | ||
.then((countRow2) => { | ||
// cy.log(countRow2); | ||
|
||
expect(+countRow1 + +countRow2).to.eq(+beaconTotal); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
it('Verify beacon counts on campaign card against number on Beacons tab of campaign', () => { | ||
cy.searchForCampaign(camp); | ||
|
||
// Log starting number of campaign comments on campaign card | ||
cy.get('[cy-test=beacon-count]').then((number1) => { | ||
const beaconTotal = number1.text().split(' ').shift(); | ||
cy.get('[cy-test=beacon-count]').should('contain', beaconTotal); | ||
|
||
// Open campaign and count number of beacons showing under Beacons tab - should equal number showing on campaign card | ||
cy.selectCampaign(camp); | ||
cy.clickBeaconsTab(); | ||
cy | ||
.get('[cy-test=beacons-row]') | ||
.its('length') | ||
.then((countBeaconRows) => { | ||
// cy.log(countBeaconRows); | ||
|
||
expect(+countBeaconRows).to.eq(+beaconTotal); | ||
}); | ||
}); | ||
}); | ||
|
||
it('Verify beacon counts on Hosts tab are accurate', () => { | ||
cy.selectCampaign(camp); | ||
|
||
// Open campaign and log beacon count for first host | ||
cy | ||
.get('[cy-test=row-beacon-count]') | ||
.eq(0) | ||
.invoke('text') | ||
.then((countHost1) => { | ||
cy.log(countHost1); | ||
|
||
// Click host to open details | ||
cy.get('[cy-test=info-row]').eq(1).click(); | ||
|
||
// Go to Beacons tab and log number of beacons showing - should match count in host row | ||
cy.clickBeaconsTab(); | ||
cy | ||
.get('[cy-test=info-row]') | ||
.its('length') | ||
.then((countBeaconsHost1) => { | ||
// cy.log(countBeaconsHost1); | ||
expect(+countBeaconsHost1).to.eq(+countHost1); | ||
}); | ||
}); | ||
// Go back to Hosts and log beacon count for second host | ||
cy.get('[cy-test=explorer-mode]').click(); | ||
cy | ||
.get('[cy-test=row-beacon-count]') | ||
.eq(1) | ||
.invoke('text') | ||
.then((countHost2) => { | ||
cy.log(countHost2); | ||
|
||
// Click host to open deatails | ||
cy.get('[cy-test=info-row]').eq(2).click(); | ||
|
||
// Go to Beacons tab and log number of beacons showing - should match count in host row | ||
cy.clickBeaconsTab(); | ||
cy | ||
.get('[cy-test=info-row]') | ||
.its('length') | ||
.then((countBeaconsHost2) => { | ||
// cy.log(countBeaconsHost2); | ||
expect(+countBeaconsHost2).to.eq(+countHost2); | ||
}); | ||
}); | ||
}); | ||
|
||
it('Verify beacon counts on Operator tab are accurate', () => { | ||
cy.selectCampaign(camp); | ||
|
||
// Open campaign and go to Operator tab; log beacon count | ||
cy.get('[cy-test=operators]').click(); | ||
cy | ||
.get('[cy-test=row-beacon-count]') | ||
.invoke('text') | ||
.then((countRow) => { | ||
cy.log(countRow); | ||
|
||
// Open operator and go to Beacons tab | ||
cy.get('[cy-test=operator-row]').click(); | ||
cy.get('[cy-test=beacons]').click(); | ||
|
||
// Log number of beacons showing - should match number from Operator tab count | ||
cy | ||
.get('[cy-test=info-row]') | ||
.its('length') | ||
.then((countOperatorBeacons) => { | ||
cy.log(countOperatorBeacons); | ||
expect(+countOperatorBeacons).to.eq(+countRow); | ||
}); | ||
}); | ||
}); | ||
|
||
after(() => { | ||
cy.deleteCampaignGraphQL(camp); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.