-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(#3388): Refactor asset link test
- Loading branch information
Showing
6 changed files
with
166 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
export class AssetBtns { | ||
public static createAssetBtn() { | ||
return cy.dataCy('create-new-asset-button', { timeout: 10000 }); | ||
} | ||
|
||
public static assetNameInput() { | ||
return cy.dataCy('asset-name', { timeout: 10000 }); | ||
} | ||
|
||
public static saveAssetBtn() { | ||
return cy.dataCy('save-asset', { timeout: 10000 }); | ||
} | ||
|
||
public static basicTab() { | ||
return cy.dataCy('basic-tab', { timeout: 10000 }); | ||
} | ||
|
||
public static assetLinksTab() { | ||
return cy.dataCy('asset-links-tab', { timeout: 10000 }); | ||
} | ||
|
||
public static manageLinksBtn() { | ||
return cy.dataCy('assets-manage-links-button', { timeout: 10000 }); | ||
} | ||
|
||
public static adapterCheckbox(adapterName: string) { | ||
return cy.dataCy('select-adapters-checkbox-' + adapterName, { | ||
timeout: 10000, | ||
}); | ||
} | ||
|
||
public static dataStreamCheckbox(adapterName: string) { | ||
return cy.dataCy('select-data-stream-checkbox-' + adapterName, { | ||
timeout: 10000, | ||
}); | ||
} | ||
|
||
public static updateAssetLinksBtn() { | ||
return cy.dataCy('assets-update-links-button', { timeout: 10000 }); | ||
} | ||
|
||
public static goBackToOverviewBtn() { | ||
return cy.dataCy('save-data-explorer-go-back-to-overview', { | ||
timeout: 10000, | ||
}); | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
ui/cypress/tests/assetManagement/generalAssetTest.smoke.spec.ts
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,54 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
import { ConnectUtils } from '../../support/utils/connect/ConnectUtils'; | ||
import { AssetUtils } from '../../support/utils/asset/AssetUtils'; | ||
import { DashboardUtils } from '../../support/utils/DashboardUtils'; | ||
import { AssetBtns } from '../../support/utils/asset/AssetBtns'; | ||
|
||
describe('Creates a new adapter, add to assets', () => { | ||
const adapterName = 'Machine_Data_Simulator'; | ||
|
||
beforeEach('Setup Test', () => { | ||
cy.initStreamPipesTest(); | ||
ConnectUtils.addMachineDataSimulator(adapterName); | ||
}); | ||
|
||
it('Perform Test', () => { | ||
// Create new asset from adapters | ||
AssetUtils.goToAssets(); | ||
|
||
AssetUtils.addNewAsset('Test Asset'); | ||
|
||
AssetBtns.assetLinksTab().click(); | ||
AssetUtils.openManageAssetLinks(); | ||
|
||
AssetUtils.selectAdapterAssetLink(adapterName); | ||
AssetUtils.selectDataStreamAssetLink(adapterName); | ||
AssetBtns.updateAssetLinksBtn().click(); | ||
|
||
AssetUtils.checkAmountOfLinkedResources(2); | ||
AssetBtns.saveAssetBtn().click(); | ||
AssetUtils.goBackToOverview(); | ||
|
||
// // Leave and navigate back to Assets | ||
DashboardUtils.goToDashboard(); | ||
AssetUtils.goToAssets(); | ||
AssetUtils.checkAmountOfAssets(1); | ||
}); | ||
}); |
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