litivo-wrapper 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +71 -0
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +4 -0
- package/dist/constants.js.map +1 -0
- package/dist/helpers.d.ts +3 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +6 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/math.d.ts +5 -0
- package/dist/math.d.ts.map +1 -0
- package/dist/math.js +9 -0
- package/dist/math.js.map +1 -0
- package/dist/models/debtor.d.ts +39 -0
- package/dist/models/debtor.d.ts.map +1 -0
- package/dist/models/debtor.js +40 -0
- package/dist/models/debtor.js.map +1 -0
- package/dist/models/identification-document.d.ts +17 -0
- package/dist/models/identification-document.d.ts.map +1 -0
- package/dist/models/identification-document.js +10 -0
- package/dist/models/identification-document.js.map +1 -0
- package/dist/models/insolvency.d.ts +57 -0
- package/dist/models/insolvency.d.ts.map +1 -0
- package/dist/models/insolvency.js +20 -0
- package/dist/models/insolvency.js.map +1 -0
- package/dist/models/site.d.ts +10 -0
- package/dist/models/site.d.ts.map +1 -0
- package/dist/models/site.js +9 -0
- package/dist/models/site.js.map +1 -0
- package/dist/pages/bases/authenticated.d.ts +18 -0
- package/dist/pages/bases/authenticated.d.ts.map +1 -0
- package/dist/pages/bases/authenticated.js +23 -0
- package/dist/pages/bases/authenticated.js.map +1 -0
- package/dist/pages/bases/base.d.ts +14 -0
- package/dist/pages/bases/base.d.ts.map +1 -0
- package/dist/pages/bases/base.js +27 -0
- package/dist/pages/bases/base.js.map +1 -0
- package/dist/pages/bases/footed.d.ts +9 -0
- package/dist/pages/bases/footed.d.ts.map +1 -0
- package/dist/pages/bases/footed.js +11 -0
- package/dist/pages/bases/footed.js.map +1 -0
- package/dist/pages/bases/paged.d.ts +7 -0
- package/dist/pages/bases/paged.d.ts.map +1 -0
- package/dist/pages/bases/paged.js +8 -0
- package/dist/pages/bases/paged.js.map +1 -0
- package/dist/pages/bases/section.d.ts +11 -0
- package/dist/pages/bases/section.d.ts.map +1 -0
- package/dist/pages/bases/section.js +23 -0
- package/dist/pages/bases/section.js.map +1 -0
- package/dist/pages/components/footer.d.ts +7 -0
- package/dist/pages/components/footer.d.ts.map +1 -0
- package/dist/pages/components/footer.js +8 -0
- package/dist/pages/components/footer.js.map +1 -0
- package/dist/pages/components/header.d.ts +11 -0
- package/dist/pages/components/header.d.ts.map +1 -0
- package/dist/pages/components/header.js +20 -0
- package/dist/pages/components/header.js.map +1 -0
- package/dist/pages/components/sideBar.d.ts +7 -0
- package/dist/pages/components/sideBar.d.ts.map +1 -0
- package/dist/pages/components/sideBar.js +8 -0
- package/dist/pages/components/sideBar.js.map +1 -0
- package/dist/pages/dashboard.d.ts +8 -0
- package/dist/pages/dashboard.d.ts.map +1 -0
- package/dist/pages/dashboard.js +10 -0
- package/dist/pages/dashboard.js.map +1 -0
- package/dist/pages/insolvency/create.d.ts +21 -0
- package/dist/pages/insolvency/create.d.ts.map +1 -0
- package/dist/pages/insolvency/create.js +60 -0
- package/dist/pages/insolvency/create.js.map +1 -0
- package/dist/pages/login.d.ts +15 -0
- package/dist/pages/login.d.ts.map +1 -0
- package/dist/pages/login.js +26 -0
- package/dist/pages/login.js.map +1 -0
- package/dist/pages/sections/application-submission.d.ts +7 -0
- package/dist/pages/sections/application-submission.d.ts.map +1 -0
- package/dist/pages/sections/application-submission.js +9 -0
- package/dist/pages/sections/application-submission.js.map +1 -0
- package/dist/pages/sections/assets.d.ts +7 -0
- package/dist/pages/sections/assets.d.ts.map +1 -0
- package/dist/pages/sections/assets.js +9 -0
- package/dist/pages/sections/assets.js.map +1 -0
- package/dist/pages/sections/attached-documents.d.ts +7 -0
- package/dist/pages/sections/attached-documents.d.ts.map +1 -0
- package/dist/pages/sections/attached-documents.js +9 -0
- package/dist/pages/sections/attached-documents.js.map +1 -0
- package/dist/pages/sections/available-resources.d.ts +7 -0
- package/dist/pages/sections/available-resources.d.ts.map +1 -0
- package/dist/pages/sections/available-resources.js +9 -0
- package/dist/pages/sections/available-resources.js.map +1 -0
- package/dist/pages/sections/causes.d.ts +7 -0
- package/dist/pages/sections/causes.d.ts.map +1 -0
- package/dist/pages/sections/causes.js +9 -0
- package/dist/pages/sections/causes.js.map +1 -0
- package/dist/pages/sections/child-support-obligations.d.ts +7 -0
- package/dist/pages/sections/child-support-obligations.d.ts.map +1 -0
- package/dist/pages/sections/child-support-obligations.js +9 -0
- package/dist/pages/sections/child-support-obligations.js.map +1 -0
- package/dist/pages/sections/creditor.d.ts +7 -0
- package/dist/pages/sections/creditor.d.ts.map +1 -0
- package/dist/pages/sections/creditor.js +9 -0
- package/dist/pages/sections/creditor.js.map +1 -0
- package/dist/pages/sections/debt-negotiation.d.ts +7 -0
- package/dist/pages/sections/debt-negotiation.d.ts.map +1 -0
- package/dist/pages/sections/debt-negotiation.js +9 -0
- package/dist/pages/sections/debt-negotiation.js.map +1 -0
- package/dist/pages/sections/debtor.d.ts +19 -0
- package/dist/pages/sections/debtor.d.ts.map +1 -0
- package/dist/pages/sections/debtor.js +40 -0
- package/dist/pages/sections/debtor.js.map +1 -0
- package/dist/pages/sections/judicial-administrative-or-private-proceedings.d.ts +9 -0
- package/dist/pages/sections/judicial-administrative-or-private-proceedings.d.ts.map +1 -0
- package/dist/pages/sections/judicial-administrative-or-private-proceedings.js +11 -0
- package/dist/pages/sections/judicial-administrative-or-private-proceedings.js.map +1 -0
- package/dist/pages/sections/site.d.ts +14 -0
- package/dist/pages/sections/site.d.ts.map +1 -0
- package/dist/pages/sections/site.js +28 -0
- package/dist/pages/sections/site.js.map +1 -0
- package/dist/wrapper.d.ts +38 -0
- package/dist/wrapper.d.ts.map +1 -0
- package/dist/wrapper.js +63 -0
- package/dist/wrapper.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import BaseSection from '../bases/section.js';
|
|
2
|
+
/** TODO: Child Support Obligations (feat: extend create insolvency method with child support obligations section) */
|
|
3
|
+
class ChildSupportObligationsSection extends BaseSection {
|
|
4
|
+
async send(childSupportObligations) {
|
|
5
|
+
throw new Error('Method not implemented.');
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export default ChildSupportObligationsSection;
|
|
9
|
+
//# sourceMappingURL=child-support-obligations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-support-obligations.js","sourceRoot":"","sources":["../../../src/pages/sections/child-support-obligations.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,qHAAqH;AACrH,MAAM,8BAA+B,SAAQ,WAAsB;IAC1D,KAAK,CAAC,IAAI,CAAC,uBAAgC;QAChD,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,eAAe,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import BaseSection from '../bases/section.js';
|
|
2
|
+
/** TODO: Creditor (feat: extend create insolvency method with creditor section) */
|
|
3
|
+
declare class CreditorSection extends BaseSection<[unknown]> {
|
|
4
|
+
send(creditor: unknown): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export default CreditorSection;
|
|
7
|
+
//# sourceMappingURL=creditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creditor.d.ts","sourceRoot":"","sources":["../../../src/pages/sections/creditor.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,mFAAmF;AACnF,cAAM,eAAgB,SAAQ,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC;IACrC,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAGpD;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import BaseSection from '../bases/section.js';
|
|
2
|
+
/** TODO: Creditor (feat: extend create insolvency method with creditor section) */
|
|
3
|
+
class CreditorSection extends BaseSection {
|
|
4
|
+
async send(creditor) {
|
|
5
|
+
throw new Error('Method not implemented.');
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export default CreditorSection;
|
|
9
|
+
//# sourceMappingURL=creditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creditor.js","sourceRoot":"","sources":["../../../src/pages/sections/creditor.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,mFAAmF;AACnF,MAAM,eAAgB,SAAQ,WAAsB;IAC3C,KAAK,CAAC,IAAI,CAAC,QAAiB;QACjC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import BaseSection from '../bases/section.js';
|
|
2
|
+
/** TODO: Debt Negotiation (feat: extend create insolvency method with debt negotiation section) */
|
|
3
|
+
declare class DebtNegotiationSection extends BaseSection<[unknown]> {
|
|
4
|
+
send(debtNegotiation: unknown): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export default DebtNegotiationSection;
|
|
7
|
+
//# sourceMappingURL=debt-negotiation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debt-negotiation.d.ts","sourceRoot":"","sources":["../../../src/pages/sections/debt-negotiation.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,mGAAmG;AACnG,cAAM,sBAAuB,SAAQ,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3D;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import BaseSection from '../bases/section.js';
|
|
2
|
+
/** TODO: Debt Negotiation (feat: extend create insolvency method with debt negotiation section) */
|
|
3
|
+
class DebtNegotiationSection extends BaseSection {
|
|
4
|
+
async send(debtNegotiation) {
|
|
5
|
+
throw new Error('Method not implemented.');
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export default DebtNegotiationSection;
|
|
9
|
+
//# sourceMappingURL=debt-negotiation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debt-negotiation.js","sourceRoot":"","sources":["../../../src/pages/sections/debt-negotiation.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,mGAAmG;AACnG,MAAM,sBAAuB,SAAQ,WAAsB;IAClD,KAAK,CAAC,IAAI,CAAC,eAAwB;QACxC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Page } from 'playwright';
|
|
2
|
+
import type { DebtorType } from '../../models/debtor.js';
|
|
3
|
+
import BaseSection from '../bases/section.js';
|
|
4
|
+
/**
|
|
5
|
+
* TODO: Debtor (feat: extend create insolvency method with debtor section)
|
|
6
|
+
* TODO: check the next BUSINESS LOGIC: Debtors can have just one insolvency application at a time.
|
|
7
|
+
* TODO: Check if it is possible to used a tuple instead of an array.
|
|
8
|
+
*/
|
|
9
|
+
declare class DebtorSection extends BaseSection<[DebtorType[]]> {
|
|
10
|
+
private readonly addDebtorButton;
|
|
11
|
+
private readonly idTypeInput;
|
|
12
|
+
private readonly idNumberInput;
|
|
13
|
+
private readonly searchButton;
|
|
14
|
+
private readonly debtorInput;
|
|
15
|
+
constructor(page: Page);
|
|
16
|
+
send(debtors: DebtorType[]): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export default DebtorSection;
|
|
19
|
+
//# sourceMappingURL=debtor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debtor.d.ts","sourceRoot":"","sources":["../../../src/pages/sections/debtor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,wBAAwB,CAAC;AACpE,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C;;;;GAIG;AACH,cAAM,aAAc,SAAQ,WAAW,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;IACrD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAU;IAC1C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAU;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAU;IACxC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAU;IACvC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAU;gBAEnB,IAAI,EAAE,IAAI;IAQhB,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAqBxD;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getInputSelector } from '../../helpers.js';
|
|
2
|
+
import BaseSection from '../bases/section.js';
|
|
3
|
+
/**
|
|
4
|
+
* TODO: Debtor (feat: extend create insolvency method with debtor section)
|
|
5
|
+
* TODO: check the next BUSINESS LOGIC: Debtors can have just one insolvency application at a time.
|
|
6
|
+
* TODO: Check if it is possible to used a tuple instead of an array.
|
|
7
|
+
*/
|
|
8
|
+
class DebtorSection extends BaseSection {
|
|
9
|
+
addDebtorButton;
|
|
10
|
+
idTypeInput;
|
|
11
|
+
idNumberInput;
|
|
12
|
+
searchButton;
|
|
13
|
+
debtorInput;
|
|
14
|
+
constructor(page) {
|
|
15
|
+
super(page);
|
|
16
|
+
this.addDebtorButton = page.locator('app-insolvencia-deudor button.btn-guardar');
|
|
17
|
+
this.idTypeInput = page.locator(getInputSelector('tipoDocumento'));
|
|
18
|
+
this.idNumberInput = page.locator('input[formcontrolname="numeroIdentificacion"]');
|
|
19
|
+
this.searchButton = page.locator('span', { hasText: 'Buscar' }); // TODO: Find a better way to get the search button.
|
|
20
|
+
this.debtorInput = page.locator(getInputSelector('deudor'));
|
|
21
|
+
}
|
|
22
|
+
async send(debtors) {
|
|
23
|
+
const page = this.page;
|
|
24
|
+
for (const debtor of debtors) {
|
|
25
|
+
const idDoc = debtor.idDoc;
|
|
26
|
+
const docType = idDoc.type;
|
|
27
|
+
const docNumber = idDoc.number;
|
|
28
|
+
await this.addDebtorButton.click();
|
|
29
|
+
await this.selectOption(this.idTypeInput, docType);
|
|
30
|
+
await this.idNumberInput.fill(docNumber);
|
|
31
|
+
await this.searchButton.click();
|
|
32
|
+
// Checking manually if the search was successful.
|
|
33
|
+
await page.waitForTimeout(5_000);
|
|
34
|
+
// await page.locator('app-formulario-participante').screenshot({ path: 'debtor.png' });
|
|
35
|
+
this.debtorInput; // Breakpoint line. TODO: Use this locator.
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export default DebtorSection;
|
|
40
|
+
//# sourceMappingURL=debtor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debtor.js","sourceRoot":"","sources":["../../../src/pages/sections/debtor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C;;;;GAIG;AACH,MAAM,aAAc,SAAQ,WAA2B;IACpC,eAAe,CAAU;IACzB,WAAW,CAAU;IACrB,aAAa,CAAU;IACvB,YAAY,CAAU;IACtB,WAAW,CAAU;IAEtC,YAAmB,IAAU;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,eA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
2
|
+
/** TODO: Judicial, Administrative, or Private Proceedings (feat: extend create insolvency method with judicial, administrative, or private proceedings section) */
|
|
3
|
+
declare class JudicialAdministrativeOrPrivateProceedingsSection extends BaseSection<[unknown]> {
|
|
4
|
+
send(judicialAdministrativeOrPrivateProceedings: unknown): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
declare class JAOPPSection extends JudicialAdministrativeOrPrivateProceedingsSection {
|
|
7
|
+
}
|
|
8
|
+
export default JAOPPSection;
|
|
9
|
+
//# sourceMappingURL=judicial-administrative-or-private-proceedings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"judicial-administrative-or-private-proceedings.d.ts","sourceRoot":"","sources":["../../../src/pages/sections/judicial-administrative-or-private-proceedings.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,mKAAmK;AACnK,cAAM,iDAAkD,SAAQ,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC;IACvE,IAAI,CAAC,0CAA0C,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtF;AAED,cAAM,YAAa,SAAQ,iDAAiD;CAAG;AAE/E,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import BaseSection from '../bases/section.js';
|
|
2
|
+
/** TODO: Judicial, Administrative, or Private Proceedings (feat: extend create insolvency method with judicial, administrative, or private proceedings section) */
|
|
3
|
+
class JudicialAdministrativeOrPrivateProceedingsSection extends BaseSection {
|
|
4
|
+
async send(judicialAdministrativeOrPrivateProceedings) {
|
|
5
|
+
throw new Error('Method not implemented.');
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
class JAOPPSection extends JudicialAdministrativeOrPrivateProceedingsSection {
|
|
9
|
+
}
|
|
10
|
+
export default JAOPPSection;
|
|
11
|
+
//# sourceMappingURL=judicial-administrative-or-private-proceedings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"judicial-administrative-or-private-proceedings.js","sourceRoot":"","sources":["../../../src/pages/sections/judicial-administrative-or-private-proceedings.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,mKAAmK;AACnK,MAAM,iDAAkD,SAAQ,WAAsB;IAC7E,KAAK,CAAC,IAAI,CAAC,0CAAmD;QACnE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,MAAM,YAAa,SAAQ,iDAAiD;CAAG;AAE/E,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Page } from 'playwright';
|
|
2
|
+
import type { SiteType } from '../../models/site.js';
|
|
3
|
+
import BaseSection from '../bases/section.js';
|
|
4
|
+
declare class SiteSection extends BaseSection<[SiteType]> {
|
|
5
|
+
private readonly departmentInput;
|
|
6
|
+
private readonly cityInput;
|
|
7
|
+
private readonly sponsorEntityInput;
|
|
8
|
+
private readonly branchCenterInput;
|
|
9
|
+
private readonly submitButton;
|
|
10
|
+
constructor(page: Page);
|
|
11
|
+
send(site: SiteType): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export default SiteSection;
|
|
14
|
+
//# sourceMappingURL=site.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../../../src/pages/sections/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAE9C,cAAM,WAAY,SAAQ,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC/C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAU;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;IACpC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAU;IAC7C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAU;IAC5C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAU;gBAE3B,IAAI,EAAE,IAAI;IAST,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAUjD;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getInputSelector } from '../../helpers.js';
|
|
2
|
+
import BaseSection from '../bases/section.js';
|
|
3
|
+
class SiteSection extends BaseSection {
|
|
4
|
+
departmentInput;
|
|
5
|
+
cityInput;
|
|
6
|
+
sponsorEntityInput;
|
|
7
|
+
branchCenterInput;
|
|
8
|
+
submitButton;
|
|
9
|
+
constructor(page) {
|
|
10
|
+
super(page);
|
|
11
|
+
this.departmentInput = page.locator(getInputSelector('departamento'));
|
|
12
|
+
this.cityInput = page.locator(getInputSelector('ciudad'));
|
|
13
|
+
this.sponsorEntityInput = page.locator(getInputSelector('entidad'));
|
|
14
|
+
this.branchCenterInput = page.locator(getInputSelector('sede'));
|
|
15
|
+
this.submitButton = page.locator('button.btn-guardar:not([disabled])');
|
|
16
|
+
}
|
|
17
|
+
async send(site) {
|
|
18
|
+
// TODO: Check if is it possible to optimice by creating a custom object or doing a for loop.
|
|
19
|
+
await this.fillInput(this.departmentInput, site.department);
|
|
20
|
+
await this.fillInput(this.cityInput, site.city);
|
|
21
|
+
await this.fillInput(this.sponsorEntityInput, site.sponsorEntity);
|
|
22
|
+
await this.fillInput(this.branchCenterInput, site.branchCenter);
|
|
23
|
+
await this.submitButton.click();
|
|
24
|
+
await this.branchCenterInput.waitFor({ state: 'detached' });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export default SiteSection;
|
|
28
|
+
//# sourceMappingURL=site.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site.js","sourceRoot":"","sources":["../../../src/pages/sections/site.ts"],"names":[],"mappings":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IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { BrowserContext } from 'playwright';
|
|
2
|
+
/** Wrapper class for Litivo interactions using Playwright.
|
|
3
|
+
*
|
|
4
|
+
* TODO: Check if multiple pages can be handled at the same time.
|
|
5
|
+
*/
|
|
6
|
+
declare class Litivo {
|
|
7
|
+
private readonly context;
|
|
8
|
+
private page;
|
|
9
|
+
private authenticatedPage;
|
|
10
|
+
private createInsolvencyPage;
|
|
11
|
+
constructor(context: BrowserContext);
|
|
12
|
+
/** Logs into Litivo with the provided credentials.
|
|
13
|
+
*
|
|
14
|
+
* NOTE: This method acts as an async constructor.
|
|
15
|
+
*
|
|
16
|
+
* TODO: Throws an error if already logged in with this wrapper.
|
|
17
|
+
*/
|
|
18
|
+
login(email: string, password: string): Promise<void>;
|
|
19
|
+
/** Creates a new insolvency.
|
|
20
|
+
*
|
|
21
|
+
* TODO: Abstract some actions into their own page models if needed.
|
|
22
|
+
* TODO: check if it is responsability to check insolvency object here.
|
|
23
|
+
* TODO: Find a way to show input options.
|
|
24
|
+
* TODO: Check bug where playwright vscode extension debugger does not raise timeout errors. May a general playwright problem.
|
|
25
|
+
*/
|
|
26
|
+
createInsolvency(data: unknown): Promise<void>;
|
|
27
|
+
logout(): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Checks if the Litivo session is logged in.
|
|
30
|
+
*
|
|
31
|
+
* Checked by verifying if cannot go to the dashboard page or login page or something like that.
|
|
32
|
+
*/
|
|
33
|
+
isLoggedIn(): Promise<boolean>;
|
|
34
|
+
/** Wait for a specific timeout in milliseconds. */
|
|
35
|
+
waitforTimeout(timeout: number): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
export default Litivo;
|
|
38
|
+
//# sourceMappingURL=wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../src/wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAQ,MAAM,YAAY,CAAC;AAQvD;;;GAGG;AACH,cAAM,MAAM;IAKS,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJ3C,OAAO,CAAC,IAAI,CAAQ;IACpB,OAAO,CAAC,iBAAiB,CAAqB;IAC9C,OAAO,CAAC,oBAAoB,CAAwB;gBAEhB,OAAO,EAAE,cAAc;IAE3D;;;;;OAKG;IACU,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAclE;;;;;;OAMG;IAEU,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9C,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAKpC;;;;OAIG;IACU,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAI3C,mDAAmD;IAC5C,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtD;AAED,eAAe,MAAM,CAAC"}
|
package/dist/wrapper.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { InsolvencySchema } from './models/insolvency.js';
|
|
2
|
+
import AuthenticatedPage from './pages/bases/authenticated.js';
|
|
3
|
+
import DashboardPage from './pages/dashboard.js';
|
|
4
|
+
import CreateInsolvencyPage from './pages/insolvency/create.js';
|
|
5
|
+
import LoginPage from './pages/login.js';
|
|
6
|
+
/** Wrapper class for Litivo interactions using Playwright.
|
|
7
|
+
*
|
|
8
|
+
* TODO: Check if multiple pages can be handled at the same time.
|
|
9
|
+
*/
|
|
10
|
+
class Litivo {
|
|
11
|
+
context;
|
|
12
|
+
page;
|
|
13
|
+
authenticatedPage; // TODO: Unknown loggin session time, in the future may need to handle re-login.
|
|
14
|
+
createInsolvencyPage;
|
|
15
|
+
constructor(context) {
|
|
16
|
+
this.context = context;
|
|
17
|
+
}
|
|
18
|
+
/** Logs into Litivo with the provided credentials.
|
|
19
|
+
*
|
|
20
|
+
* NOTE: This method acts as an async constructor.
|
|
21
|
+
*
|
|
22
|
+
* TODO: Throws an error if already logged in with this wrapper.
|
|
23
|
+
*/
|
|
24
|
+
async login(email, password) {
|
|
25
|
+
const page = await this.context.newPage(); // TODO: Check if it will be good to close former pagge if it setted up yet.
|
|
26
|
+
const loginPage = new LoginPage(page);
|
|
27
|
+
await loginPage.login(email, password);
|
|
28
|
+
const dashboardPage = new DashboardPage(page);
|
|
29
|
+
await dashboardPage.goto();
|
|
30
|
+
this.page = page;
|
|
31
|
+
this.authenticatedPage = dashboardPage;
|
|
32
|
+
this.createInsolvencyPage = new CreateInsolvencyPage(page);
|
|
33
|
+
}
|
|
34
|
+
/** Creates a new insolvency.
|
|
35
|
+
*
|
|
36
|
+
* TODO: Abstract some actions into their own page models if needed.
|
|
37
|
+
* TODO: check if it is responsability to check insolvency object here.
|
|
38
|
+
* TODO: Find a way to show input options.
|
|
39
|
+
* TODO: Check bug where playwright vscode extension debugger does not raise timeout errors. May a general playwright problem.
|
|
40
|
+
*/
|
|
41
|
+
async createInsolvency(data) {
|
|
42
|
+
const insolvency = InsolvencySchema.parse(data);
|
|
43
|
+
await this.createInsolvencyPage.createInsolvency(insolvency);
|
|
44
|
+
}
|
|
45
|
+
async logout() {
|
|
46
|
+
await this.authenticatedPage.logout();
|
|
47
|
+
await this.page.close();
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Checks if the Litivo session is logged in.
|
|
51
|
+
*
|
|
52
|
+
* Checked by verifying if cannot go to the dashboard page or login page or something like that.
|
|
53
|
+
*/
|
|
54
|
+
async isLoggedIn() {
|
|
55
|
+
throw new Error('Method not implemented.');
|
|
56
|
+
}
|
|
57
|
+
/** Wait for a specific timeout in milliseconds. */
|
|
58
|
+
waitforTimeout(timeout) {
|
|
59
|
+
return this.page.waitForTimeout(timeout);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export default Litivo;
|
|
63
|
+
//# sourceMappingURL=wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../src/wrapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;AAC/D,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAChE,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAEzC;;;GAGG;AACH,MAAM,MAAM;IAK0B;IAJ5B,IAAI,CAAQ;IACZ,iBAAiB,CAAqB,CAAC,gFAAgF;IACvH,oBAAoB,CAAwB;IAEpD,YAAoC,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAG,CAAC;IAE/D;;;;;OAKG;IACI,KAAK,CAAC,KAAK,CAAC,KAAa,EAAE,QAAgB;QAChD,MAAM,IAAI,GAAS,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,4EAA4E;QAE7H,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAEvC,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;QAC9C,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC;QAE3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,iBAAiB,GAAG,aAAa,CAAC;QACvC,IAAI,CAAC,oBAAoB,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IAEI,KAAK,CAAC,gBAAgB,CAAC,IAAa;QACzC,MAAM,UAAU,GAAmB,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChE,MAAM,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC/D,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,UAAU;QACrB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,mDAAmD;IAC5C,cAAc,CAAC,OAAe;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;CACF;AAED,eAAe,MAAM,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "litivo-wrapper",
|
|
3
|
+
"version": "0.3.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Litivo Wrapper.",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"keywords": [
|
|
19
|
+
"playwright",
|
|
20
|
+
"automation",
|
|
21
|
+
"litivo",
|
|
22
|
+
"testing",
|
|
23
|
+
"wrapper"
|
|
24
|
+
],
|
|
25
|
+
"author": "CesarZHX <112836949+CesarZHX@users.noreply.github.com> (https://github.com/CesarZHX/)",
|
|
26
|
+
"license": "Apache-2.0",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/CesarZHX/litivo-wrapper-js.git"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@playwright/test": "^1.58.0",
|
|
33
|
+
"@types/node": "^25.0.10",
|
|
34
|
+
"env-var": "^7.5.0",
|
|
35
|
+
"tsx": "^4.21.0",
|
|
36
|
+
"typescript": "^5.9.3",
|
|
37
|
+
"vitest": "^4.0.18"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"playwright": "^1.58.0",
|
|
41
|
+
"zod": "^4.3.6"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc",
|
|
45
|
+
"example": "tsc && tsx example",
|
|
46
|
+
"test": "vitest run && playwright test",
|
|
47
|
+
"test:unit": "vitest",
|
|
48
|
+
"test:e2e": "playwright test",
|
|
49
|
+
"test:ui": "playwright test --ui"
|
|
50
|
+
}
|
|
51
|
+
}
|