Skip to content
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

Pupeteer changes for artifactory after artifactory upgrade #60

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions src/services/artifactory-setup/artifactory-setup.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ export class SetupArtifactoryImpl {
this.loggingApi.log(`Getting started`);

await this.loggingApi.snapshot(page, 'getting-started-before');
await page.click('button.get-started');
//await page.click('button.get-started');
//await page.click('button.Get Started');
await page.click('button.el-button--primary');


await timer(1000);

Expand All @@ -126,15 +129,16 @@ export class SetupArtifactoryImpl {
return document.querySelector<HTMLElement>('.step-wrapper .title').innerText;
});

this.loggingApi.log('On page: ' + await handle.jsonValue());
this.loggingApi.log('On page: ' + await handle.jsonValue());

this.loggingApi.log(`Resetting admin password`);

const newPassword = generator.generate({
length: 20,
uppercase: true,
lowercase: true,
symbols: true
symbols: true,
numbers: true
});

await this.loggingApi.snapshot(page, 'reset-password-before');
Expand Down Expand Up @@ -167,11 +171,13 @@ export class SetupArtifactoryImpl {

await this.loggingApi.snapshot(page, 'set-base-url-before');

await page.focus('.base-url-wrapper input');
//await page.focus('.base-url-wrapper input');
await page.focus('.el-input__inner input');
await page.keyboard.type(url);

await this.loggingApi.snapshot(page, 'set-base-url-mid');
await page.click('.el-footer button.el-button--primary');
//await page.click('footer button.Next');

await timer(1000);

Expand All @@ -193,7 +199,8 @@ export class SetupArtifactoryImpl {
await this.loggingApi.snapshot(page, 'configure-proxy-before');
await page.evaluateHandle(() => {
const skipButtonIndex = 1;
document.querySelectorAll<HTMLInputElement>('button.el-button--secondary')
//document.querySelectorAll<HTMLInputElement>('button.el-button--secondary')
document.querySelectorAll<HTMLInputElement>('button.el-button--transparent')
.item(skipButtonIndex)
.click();
});
Expand All @@ -215,7 +222,8 @@ export class SetupArtifactoryImpl {

await this.loggingApi.snapshot(page, 'create-repositories-before');
await page.evaluateHandle(() => {
document.querySelectorAll<HTMLInputElement>('input[type=checkbox]')
//document.querySelectorAll<HTMLInputElement>('input[type=checkbox]')
document.querySelectorAll<HTMLInputElement>('.span.icon-image iconrepo iconrepo-generic')
.forEach(e => e.click());
});

Expand Down