forked from podman-desktop/podman-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(test): implementing podman machine creation through onboarding …
…workflow e2e test (podman-desktop#5800) * chore(test): implementing podman machine creation through onboarding workflow e2e test Signed-off-by: Tibor Dancs (tdancs old laptop podman-desktop windows testing) <[email protected]> --------- Signed-off-by: Tibor Dancs <[email protected]> Co-authored-by: Vladimir Lazar <[email protected]>
- Loading branch information
Showing
9 changed files
with
432 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/********************************************************************** | ||
* Copyright (C) 2024 Red Hat, Inc. | ||
* | ||
* Licensed 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. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
***********************************************************************/ | ||
|
||
import type { Locator, Page } from '@playwright/test'; | ||
import { BasePage } from './base-page'; | ||
|
||
export class OnboardingPage extends BasePage { | ||
readonly mainPage: Locator; | ||
readonly header: Locator; | ||
readonly onboardingComponent: Locator; | ||
readonly onboardingStatusMessage: Locator; | ||
readonly nextStepButton: Locator; | ||
readonly cancelSetupButtion: Locator; | ||
|
||
constructor(page: Page) { | ||
super(page); | ||
this.mainPage = page.getByRole('region', { name: 'Onboarding Body' }); | ||
this.header = this.mainPage.getByRole('heading', { name: 'Header' }); | ||
this.onboardingComponent = this.mainPage.getByLabel('Onboarding Component'); | ||
this.onboardingStatusMessage = this.mainPage.getByLabel('Onboarding Status Message'); | ||
this.nextStepButton = this.mainPage.getByRole('button', { name: 'Next Step' }); | ||
this.cancelSetupButtion = this.mainPage.getByRole('button', { name: 'Cancel Setup' }); | ||
} | ||
} |
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,44 @@ | ||
/********************************************************************** | ||
* Copyright (C) 2024 Red Hat, Inc. | ||
* | ||
* Licensed 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. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
***********************************************************************/ | ||
|
||
import type { Locator, Page } from '@playwright/test'; | ||
import { ResourcesPage } from './resources-page'; | ||
|
||
export class PodmanMachineDetails extends ResourcesPage { | ||
readonly podmanMachineName: Locator; | ||
readonly podmanMachineStatus: Locator; | ||
readonly podmanMachineConnectionActions: Locator; | ||
readonly podmanMachineStartButton: Locator; | ||
readonly podmanMachineRestartButton: Locator; | ||
readonly podmanMachineStopButton: Locator; | ||
readonly podmanMachineDeleteButton: Locator; | ||
|
||
constructor(page: Page) { | ||
super(page); | ||
this.podmanMachineName = this.getPage().getByRole('heading', { name: 'Podman Machine' }); | ||
this.podmanMachineStatus = this.getPage().getByLabel('Connection Status Label'); | ||
this.podmanMachineConnectionActions = this.getPage().getByRole('group', { name: 'Connection Actions' }); | ||
this.podmanMachineStartButton = this.podmanMachineConnectionActions.getByRole('button', { | ||
name: 'Start', | ||
exact: true, | ||
}); | ||
this.podmanMachineRestartButton = this.podmanMachineConnectionActions.getByRole('button', { name: 'Restart' }); | ||
this.podmanMachineStopButton = this.podmanMachineConnectionActions.getByRole('button', { name: 'Stop' }); | ||
this.podmanMachineDeleteButton = this.podmanMachineConnectionActions.getByRole('button', { name: 'Delete' }); | ||
} | ||
} |
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,62 @@ | ||
/********************************************************************** | ||
* Copyright (C) 2024 Red Hat, Inc. | ||
* | ||
* Licensed 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. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
***********************************************************************/ | ||
|
||
import type { Locator, Page } from '@playwright/test'; | ||
import { OnboardingPage } from './onboarding-page'; | ||
|
||
export class PodmanOnboardingPage extends OnboardingPage { | ||
readonly podmanAutostartToggle: Locator; | ||
readonly createMachinePageTitle: Locator; | ||
readonly podmanMachineConfiguration: Locator; | ||
readonly podmanMachineName: Locator; | ||
readonly podmanMachineCPUs: Locator; | ||
readonly podmanMachineMemory: Locator; | ||
readonly podmanMachineDiskSize: Locator; | ||
readonly podmanMachineImage: Locator; | ||
readonly podmanMachineRootfulCheckbox: Locator; | ||
readonly podmanMachineUserModeNetworkingCheckbox: Locator; | ||
readonly podmanMachineStartAfterCreationCheckbox: Locator; | ||
readonly podmanMachineCreateButton: Locator; | ||
readonly podmanMachineShowLogsButton: Locator; | ||
|
||
constructor(page: Page) { | ||
super(page); | ||
this.podmanAutostartToggle = this.mainPage.getByRole('checkbox', { | ||
name: 'Autostart Podman engine when launching Podman Desktop', | ||
}); | ||
this.createMachinePageTitle = this.onboardingComponent.getByLabel('title'); | ||
this.podmanMachineConfiguration = this.mainPage.getByRole('form', { name: 'Properties Information' }); | ||
this.podmanMachineName = this.podmanMachineConfiguration.getByRole('textbox', { name: 'Name' }); | ||
this.podmanMachineCPUs = this.podmanMachineConfiguration.getByRole('slider', { name: 'CPU(s)' }); | ||
this.podmanMachineMemory = this.podmanMachineConfiguration.getByRole('slider', { name: 'Memory' }); | ||
this.podmanMachineDiskSize = this.podmanMachineConfiguration.getByRole('slider', { name: 'Disk size' }); | ||
this.podmanMachineImage = this.podmanMachineConfiguration.getByRole('textbox', { name: 'Image Path (Optional)' }); | ||
this.podmanMachineRootfulCheckbox = this.podmanMachineConfiguration.getByRole('checkbox', { | ||
name: 'Machine with root privileges', | ||
}); | ||
this.podmanMachineUserModeNetworkingCheckbox = this.podmanMachineConfiguration.getByRole('checkbox', { | ||
name: 'User mode networking', | ||
exact: false, | ||
}); | ||
this.podmanMachineStartAfterCreationCheckbox = this.podmanMachineConfiguration.getByRole('checkbox', { | ||
name: 'Start the machine now', | ||
}); | ||
this.podmanMachineCreateButton = this.podmanMachineConfiguration.getByRole('button', { name: 'Create' }); | ||
this.podmanMachineShowLogsButton = this.mainPage.getByRole('button', { name: 'Show Logs' }); | ||
} | ||
} |
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
45 changes: 45 additions & 0 deletions
45
tests/src/model/pages/resources-podman-connections-page.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,45 @@ | ||
/********************************************************************** | ||
* Copyright (C) 2024 Red Hat, Inc. | ||
* | ||
* Licensed 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. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
***********************************************************************/ | ||
|
||
import type { Locator, Page } from '@playwright/test'; | ||
import { ResourcesPage } from './resources-page'; | ||
|
||
export class ResourcesPodmanConnections extends ResourcesPage { | ||
readonly providerConnections: Locator; | ||
readonly podmanMachineElement: Locator; | ||
readonly machineConnectionStatus: Locator; | ||
readonly machineDetailsButton: Locator; | ||
readonly machineConnectionActions: Locator; | ||
readonly machineStartButton: Locator; | ||
readonly machineRestartButton: Locator; | ||
readonly machineStopButton: Locator; | ||
readonly machineDeleteButton: Locator; | ||
|
||
constructor(page: Page, machineVisibleName: string) { | ||
super(page); | ||
this.providerConnections = this.podmanResources.getByRole('region', { name: 'Provider Connections' }); | ||
this.podmanMachineElement = this.providerConnections.getByRole('region', { name: machineVisibleName }); | ||
this.machineConnectionStatus = this.podmanMachineElement.getByLabel('Connection Status Label'); | ||
this.machineDetailsButton = this.podmanMachineElement.getByRole('button', { name: 'Podman details' }); | ||
this.machineConnectionActions = this.podmanMachineElement.getByRole('group', { name: 'Connection Actions' }); | ||
this.machineStartButton = this.machineConnectionActions.getByRole('button', { name: 'Start', exact: true }); | ||
this.machineRestartButton = this.machineConnectionActions.getByRole('button', { name: 'Restart' }); | ||
this.machineStopButton = this.machineConnectionActions.getByRole('button', { name: 'Stop' }); | ||
this.machineDeleteButton = this.machineConnectionActions.getByRole('button', { name: 'Delete' }); | ||
} | ||
} |
Oops, something went wrong.