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 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update tests and commands. * Test updates * Updates to tests previously being skipped. * Update tests for clean-up. * Minor test updates. * Minor test update. * Minor test update. * Minor test update.
- Loading branch information
1 parent
06b6991
commit 4cc3c1c
Showing
17 changed files
with
461 additions
and
119 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
File renamed without changes.
2 changes: 0 additions & 2 deletions
2
...egration/e2e/redteam/beacon-count.skip.js → ...ntegration/e2e/redteam/beacon-count.cy.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
37 changes: 37 additions & 0 deletions
37
applications/redeye-e2e/src/integration/e2e/redteam/beacon-details-link.cy.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,37 @@ | ||
/// <reference types="cypress" /> | ||
|
||
let linkText; | ||
|
||
describe('Beacon Details link', () => { | ||
const camp = 'beacondetailslink'; | ||
const fileName = 'gt.redeye'; | ||
|
||
it('Link on Beacon Details redirects appropriately', () => { | ||
cy.uploadCampaign(camp, fileName); | ||
|
||
// Search for new campaign by name, go go Beacons tab, select Beacon | ||
cy.selectCampaign(camp); | ||
cy.clickBeaconsTab(); | ||
cy.selectBeacon(0); | ||
|
||
// Go to Details tab and get link details | ||
cy.clickDetailsTab(); | ||
cy.get('[cy-test=meta-link]') | ||
.invoke('text') | ||
.then((link) => { | ||
linkText = link; | ||
}); | ||
|
||
// Click link and verify it redirected to the correct place | ||
cy.get('[cy-test=meta-link]').click(); | ||
cy.get('[cy-test=panel-header]') | ||
.invoke('text') | ||
.then((redirect) => { | ||
expect(redirect).to.eq(linkText); | ||
}); | ||
}); | ||
|
||
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
76 changes: 76 additions & 0 deletions
76
applications/redeye-e2e/src/integration/e2e/redteam/graphql/commands.cy.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,76 @@ | ||
import { graphqlRequest } from '../../../../support/utils'; | ||
|
||
let cmdId; | ||
describe('Query Commands & CommandsIds', () => { | ||
it('Query Commands', () => { | ||
const camp = 'commands'; | ||
|
||
cy.uploadCampaign(camp, 'gt.redeye'); | ||
|
||
cy.selectCampaign(camp); | ||
|
||
cy.clickCommandTypesTab(); | ||
|
||
cy.selectCommandType('elevate'); | ||
|
||
cy.url().then((url) => { | ||
const returnedUrl = url.split('/')[5]; | ||
|
||
const query = `query commandIds( | ||
$beaconId: String | ||
$campaignId: String! | ||
$commandIds: [String!] | ||
$commandType: String | ||
$hidden: Boolean | ||
$hostId: String | ||
$operatorId: String | ||
$sort: SortType | ||
) { | ||
commandIds( | ||
beaconId: $beaconId | ||
campaignId: $campaignId | ||
commandIds: $commandIds | ||
commandType: $commandType | ||
hidden: $hidden | ||
hostId: $hostId | ||
operatorId: $operatorId | ||
sort: $sort | ||
) | ||
}`; | ||
const variables = { campaignId: returnedUrl, commandType: 'elevate', sort: { sortBy: 'time', direction: 'ASC' } }; | ||
graphqlRequest(query, variables).then((res) => { | ||
let cmdId = res.body.data.commandIds.toString(); | ||
cy.log(cmdId); | ||
|
||
const query1 = `query commandIds( | ||
$beaconId: String | ||
$campaignId: String! | ||
$commandIds: [String!] | ||
$commandType: String | ||
$hidden: Boolean | ||
$hostId: String | ||
$operatorId: String | ||
$sort: SortType | ||
) { | ||
commandIds( | ||
beaconId: $beaconId | ||
campaignId: $campaignId | ||
commandIds: $commandIds | ||
commandType: $commandType | ||
hidden: $hidden | ||
hostId: $hostId | ||
operatorId: $operatorId | ||
sort: $sort | ||
) | ||
}`; | ||
const variables1 = { campaignId: returnedUrl, commandIds: ['a1117439-359c-4b28-a634-1a43912d0d6a'] }; | ||
graphqlRequest(query1, variables1).then((res1) => { | ||
cy.log(res1.body); | ||
}); | ||
}); | ||
cy.returnToCampaignCard(); | ||
|
||
cy.deleteCampaign(camp); | ||
}); | ||
}); | ||
}); |
40 changes: 0 additions & 40 deletions
40
applications/redeye-e2e/src/integration/e2e/redteam/graphql/commands.skip.js
This file was deleted.
Oops, something went wrong.
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
95 changes: 95 additions & 0 deletions
95
applications/redeye-e2e/src/integration/e2e/redteam/presentation-mode-edit-comments.cy.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,95 @@ | ||
/// <reference types="cypress" /> | ||
let origComment; | ||
let updatedComment; | ||
let startingTags; | ||
let endingTags; | ||
|
||
describe('Presentation Mode - Edit Comments', () => { | ||
const camp = 'editCommentsPresentationMode'; | ||
const fileName = 'gt.redeye'; | ||
|
||
it('Can edit a comment in Presentation mode', () => { | ||
const newComment = 'EDITED COMMENT'; | ||
|
||
// Upload and open campaign | ||
cy.uploadCampaign(camp, fileName); | ||
cy.selectCampaign(camp); | ||
|
||
// Go to Presentation Mode | ||
cy.clickPresentationMode(); | ||
|
||
// Click "All Comments" to open presentation | ||
cy.get('[cy-test=all]').click(); | ||
|
||
// Go to 2nd slide (first one contains an uneditable comment type) | ||
cy.get('[cy-test=next-slide]').click(); | ||
|
||
// Log current comment text | ||
cy.get('[cy-test=comment-text]') | ||
.invoke('text') | ||
.then((comment1) => { | ||
origComment = comment1; | ||
}); | ||
|
||
// Click Edit and modify the comment | ||
cy.get('[cy-test=edit-comment]').click(); | ||
cy.get('[cy-test=comment-input]').click().clear().type(newComment); | ||
cy.get('[cy-test=save-comment]').click(); | ||
|
||
// Verify new comment text appears in Presentation mode | ||
cy.get('[cy-test=comment-text]') | ||
.invoke('text') | ||
.then((comment2) => { | ||
updatedComment = comment2; | ||
expect(updatedComment).to.eq(newComment).and.to.not.eq(origComment); | ||
}); | ||
|
||
// Go to Comments tab and verify that new comment appears on the page | ||
cy.clickExplorerMode(); | ||
cy.clickCommentsTab(); | ||
cy.get('[cy-test=info-row]').eq(0).click(); | ||
cy.wait(1000); | ||
|
||
const comments = []; | ||
cy.get('[cy-test=comment-text]').each(($comment) => comments.push($comment.text())); | ||
cy.wrap(comments).as('allComments').should('contain', newComment); | ||
}); | ||
|
||
it('Cannot edit tags in Presentation mode', () => { | ||
// Open campaign | ||
cy.selectCampaign(camp); | ||
|
||
// Go to Presentation Mode | ||
cy.clickPresentationMode(); | ||
|
||
// Click "All Comments" to open presentation | ||
cy.get('[cy-test=all]').click(); | ||
|
||
// Go to 2nd slide (first one contains an uneditable comment type) | ||
cy.get('[cy-test=next-slide]').click(); | ||
|
||
// Get tag text | ||
cy.get('[cy-test=tags]') | ||
.invoke('text') | ||
.then((tags1) => { | ||
startingTags = tags1; | ||
}); | ||
|
||
// Click Edit and verify that you cannot edit the tags | ||
cy.get('[cy-test=edit-comment]').click(); | ||
cy.get('[cy-test=tag-input]').should('not.exist'); | ||
|
||
// Click Cancel and verify the tag still appears | ||
cy.get('[cy-test=cancel-comment]').click(); | ||
cy.get('[cy-test=tags]') | ||
.invoke('text') | ||
.then((tags2) => { | ||
endingTags = tags2; | ||
expect(endingTags).to.eq(startingTags); | ||
}); | ||
}); | ||
|
||
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.