2018-04-03 14:16:57 +00:00
|
|
|
import { clickable, collection, fillable, text, selectable, isPresent } from 'ember-cli-page-object';
|
|
|
|
|
|
|
|
import fields from './form-field';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
...fields,
|
|
|
|
scope: '.config-pki-ca',
|
|
|
|
text: text('[data-test-text]'),
|
|
|
|
title: text('[data-test-title]'),
|
|
|
|
|
|
|
|
hasTitle: isPresent('[data-test-title]'),
|
|
|
|
hasError: isPresent('[data-test-error]'),
|
|
|
|
hasSignIntermediateForm: isPresent('[data-test-sign-intermediate-form]'),
|
|
|
|
|
|
|
|
replaceCA: clickable('[data-test-go-replace-ca]'),
|
|
|
|
replaceCAText: text('[data-test-go-replace-ca]'),
|
|
|
|
setSignedIntermediateBtn: clickable('[data-test-go-set-signed-intermediate]'),
|
|
|
|
signIntermediateBtn: clickable('[data-test-go-sign-intermediate]'),
|
|
|
|
caType: selectable('[data-test-input="caType"]'),
|
|
|
|
submit: clickable('[data-test-submit]'),
|
|
|
|
back: clickable('[data-test-back-button]'),
|
|
|
|
|
|
|
|
signedIntermediate: fillable('[data-test-signed-intermediate]'),
|
2018-09-25 16:28:26 +00:00
|
|
|
downloadLinks: collection('[data-test-ca-download-link]'),
|
|
|
|
rows: collection('[data-test-table-row]'),
|
|
|
|
rowValues: collection('[data-test-row-value]'),
|
2018-04-03 14:16:57 +00:00
|
|
|
csr: text('[data-test-row-value="CSR"]', { normalize: false }),
|
|
|
|
csrField: fillable('[data-test-input="csr"]'),
|
|
|
|
certificate: text('[data-test-row-value="Certificate"]', { normalize: false }),
|
2021-10-04 21:31:36 +00:00
|
|
|
commonNameIsPresent: isPresent('[data-test-row-value="Common name"]'),
|
2018-04-03 14:16:57 +00:00
|
|
|
uploadCert: clickable('[data-test-input="uploadPemBundle"]'),
|
|
|
|
enterCertAsText: clickable('[data-test-text-toggle]'),
|
2021-12-17 03:44:29 +00:00
|
|
|
pemBundle: fillable('[data-test-text-file-textarea]'),
|
2018-04-03 14:16:57 +00:00
|
|
|
commonName: fillable('[data-test-input="commonName"]'),
|
|
|
|
|
2021-10-04 21:31:36 +00:00
|
|
|
issueDateIsPresent: text('[data-test-row-value="Issue date"]'),
|
|
|
|
expiryDateIsPresent: text('[data-test-row-value="Expiration date"]'),
|
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
async generateCA(commonName = 'PKI CA', type = 'root') {
|
2018-04-03 14:16:57 +00:00
|
|
|
if (type === 'intermediate') {
|
2021-12-17 03:44:29 +00:00
|
|
|
return await this.replaceCA().commonName(commonName).caType('intermediate').submit();
|
2018-04-03 14:16:57 +00:00
|
|
|
}
|
2021-12-17 03:44:29 +00:00
|
|
|
return await this.replaceCA().commonName(commonName).submit();
|
2018-04-03 14:16:57 +00:00
|
|
|
},
|
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
async uploadCA(pem) {
|
2021-12-17 03:44:29 +00:00
|
|
|
return await this.replaceCA().uploadCert().enterCertAsText().pemBundle(pem).submit();
|
2018-04-03 14:16:57 +00:00
|
|
|
},
|
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
async signIntermediate(commonName) {
|
2021-03-16 18:23:48 +00:00
|
|
|
return await this.signIntermediateBtn().commonName(commonName);
|
2018-04-03 14:16:57 +00:00
|
|
|
},
|
|
|
|
};
|