-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automated testcase for creating a bucket with cache and multids #70
Open
HaruChebrolu
wants to merge
7
commits into
red-hat-storage:master
Choose a base branch
from
HaruChebrolu:AC004
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8e7904a
Automated testcase for creating bucket with cache
HaruChebrolu 7ce5415
modularized code for creation of bucket policy
HaruChebrolu e686a24
modularized code for creation of bucket policy
HaruChebrolu caf04ae
Added testcase for multids
HaruChebrolu 9d1d1b8
Added testcase for multids
HaruChebrolu dd3708a
Merge remote-tracking branch 'upstream/master' into AC004
HaruChebrolu 49711d1
Added testcase for multids
HaruChebrolu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
import { DATA_FEDERATION_NAMESPACE } from '../constants/common'; | ||
import { DATA_SOURCE_INPUTS, Providers } from '../constants/tests'; | ||
import { createDataSource } from './data-resource'; | ||
|
||
export const BPCommon = { | ||
createUsingSingleDSAndExistingDataSource: ( | ||
bucketName: string, | ||
dataSourceName: string | ||
) => { | ||
cy.log(`creating bucket ${bucketName}`); | ||
cy.byTestID('item-create').click(); | ||
cy.log(`entering bucket name as ${bucketName}`); | ||
cy.byTestID('bucket-name-text').type(bucketName); | ||
cy.byTestID('read-write-dropdown') | ||
.should('be.visible') | ||
.find('button') | ||
.first() | ||
.click(); | ||
cy.log(`Creating new data source`); | ||
cy.contains(dataSourceName).click(); | ||
}, | ||
createUsingSingleDSAndNewDataSource: ( | ||
bucketName: string, | ||
dataSourceName: string | ||
) => { | ||
cy.log(`creating bucket ${bucketName}`); | ||
cy.byTestID('item-create').click(); | ||
cy.log(`entering bucket name as ${bucketName}`); | ||
cy.byTestID('bucket-name-text').type(bucketName); | ||
cy.byTestID('read-write-dropdown') | ||
.should('be.visible') | ||
.find('button') | ||
.first() | ||
.click(); | ||
cy.log(`Creating new data source`); | ||
cy.byTestID('add-data-source-item').click(); | ||
createDataSource( | ||
Providers.AWS, | ||
dataSourceName, | ||
DATA_SOURCE_INPUTS.targetBucket | ||
); | ||
cy.byTestID('ready-action-finish').click(); | ||
cy.byTestID('read-write-dropdown') | ||
.should('be.visible') | ||
.find('button') | ||
.first() | ||
.click(); | ||
cy.byTestID('data-source-selection-item').find('li').last().click(); | ||
}, | ||
confirmCreateBucket: () => { | ||
cy.byTestID('namespace-dropdown') | ||
.should('be.visible') | ||
.contains(DATA_FEDERATION_NAMESPACE); | ||
cy.log('Create bucket policy'); | ||
cy.byTestID('confirm-action-bucket').click(); | ||
}, | ||
createUsingMultiDS: (bucketName: string, dataSourceName: string) => { | ||
cy.log(`creating bucket ${bucketName}`); | ||
cy.byTestID('item-create').click(); | ||
cy.log(`entering bucket name as ${bucketName}`); | ||
cy.byTestID('bucket-name-text').type(bucketName); | ||
cy.byTestID('multi-data-source-radio-button').click(); | ||
cy.byTestID('read-dropdown').click(); | ||
cy.log(`Configuring a data source to read`); | ||
cy.byTestID('data-source-selection-item').click(); | ||
cy.byTestID('add-data-source-item').click(); | ||
createDataSource( | ||
Providers.AWS, | ||
dataSourceName, | ||
DATA_SOURCE_INPUTS.targetBucket | ||
); | ||
cy.byTestID('ready-action-finish').click(); | ||
cy.byTestID('read-dropdown').should('be.visible').first().click(); | ||
cy.byTestID('data-source-selection-item') | ||
.find('li') | ||
.byTestID(`${dataSourceName}-dropdown-item`) | ||
.find('input[type=checkbox]') | ||
.check(); | ||
cy.byTestID('read-dropdown').first().click(); | ||
cy.byTestID('write-dropdown').find('button').click(); | ||
cy.log(`Configuring a data source to write`); | ||
cy.byTestID('data-source-selection-item') | ||
.find('li') | ||
.byTestID(`${dataSourceName}-dropdown-item`) | ||
.click(); | ||
cy.byTestID('write-dropdown').should('be.visible').first().click(); | ||
}, | ||
checkBucketCreation: (bucketName: string, dataSourceName: string) => { | ||
cy.log('Verify bucket policy created'); | ||
cy.byTestSelector('details-item-value__Name').should('contain', bucketName); | ||
cy.log('Verify bucket policy is Ready'); | ||
cy.byTestID('status-text').should('contain', 'Ready'); | ||
cy.log('Verify only 1 data source is connected'); | ||
cy.byTestID('mcg-resource-popover') | ||
.should('be.visible') | ||
.should('contain', '1 data source'); | ||
cy.log('Verify name of the connected data source'); | ||
cy.byTestID('mcg-resource-popover').should('be.visible').click(); | ||
cy.contains(dataSourceName); | ||
cy.log('Verify if OBC is created or not'); | ||
cy.byTestID('obc-resource-popover') | ||
.should('be.visible') | ||
.should('contain', '1 ObjectBucketClaim'); | ||
}, | ||
deleteFromDetailsPage: (bucketName: string) => { | ||
cy.log(`deleting bucket ${bucketName}`); | ||
cy.byTestID(bucketName).first().click(); | ||
cy.byTestID('details-actions').find('button').click(); | ||
cy.byTestID('details-actions').find('li').last().click(); | ||
cy.byTestID('delete-action').click(); | ||
cy.byTestID(bucketName).should('not.exist'); | ||
}, | ||
}; |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have a look into this PR Idea is to bring out common stuff into a separate file as we have to the data source.
@alfonsomthd what is your opinion regarding this, should we have a common separate file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree on code reuse: let's move the common logic to a helper method on the appropriate helper file.