|
| 1 | +import { |
| 2 | + container, |
| 3 | + codecept, |
| 4 | + output, |
| 5 | + event, |
| 6 | + recorder, |
| 7 | + config, |
| 8 | + actor, |
| 9 | + helper, |
| 10 | + pause, |
| 11 | + within, |
| 12 | + dataTable, |
| 13 | + dataTableArgument, |
| 14 | + store, |
| 15 | + locator, |
| 16 | + // Secret, |
| 17 | + // secret, |
| 18 | +} from "codeceptjs"; |
| 19 | +import { expect } from "chai"; |
| 20 | + |
| 21 | +Feature("Import all exports from codeceptjs"); |
| 22 | + |
| 23 | +Scenario("container should be importable as named export", () => { |
| 24 | + expect(container).to.exist; |
| 25 | + expect(container.helpers).to.be.a("function"); |
| 26 | + |
| 27 | + const helpers = container.helpers(); |
| 28 | + console.log("Available helpers:", Object.keys(helpers)); |
| 29 | +}); |
| 30 | + |
| 31 | +Scenario("codecept should be importable", () => { |
| 32 | + expect(codecept).to.exist; |
| 33 | +}); |
| 34 | + |
| 35 | +Scenario("output should be importable", () => { |
| 36 | + expect(output).to.exist; |
| 37 | + expect(output.print).to.be.a("function"); |
| 38 | + output.print("Testing output.print"); |
| 39 | +}); |
| 40 | + |
| 41 | +Scenario("event should be importable", () => { |
| 42 | + expect(event).to.exist; |
| 43 | + expect(event).to.be.an("object"); |
| 44 | + expect(event.dispatcher).to.exist; |
| 45 | +}); |
| 46 | + |
| 47 | +Scenario("recorder should be importable", () => { |
| 48 | + expect(recorder).to.exist; |
| 49 | + expect(recorder).to.be.an("object"); |
| 50 | + expect(recorder.start).to.be.a("function"); |
| 51 | +}); |
| 52 | + |
| 53 | +Scenario("config should be importable", () => { |
| 54 | + expect(config).to.exist; |
| 55 | + expect(config.get).to.be.a("function"); |
| 56 | +}); |
| 57 | + |
| 58 | +Scenario("actor should be importable", () => { |
| 59 | + expect(actor).to.exist; |
| 60 | + expect(actor).to.be.a("function"); |
| 61 | +}); |
| 62 | + |
| 63 | +Scenario("helper should be importable", () => { |
| 64 | + expect(helper).to.exist; |
| 65 | +}); |
| 66 | + |
| 67 | +Scenario("pause should be importable", () => { |
| 68 | + expect(pause).to.exist; |
| 69 | +}); |
| 70 | + |
| 71 | +Scenario("within should be importable", () => { |
| 72 | + expect(within).to.exist; |
| 73 | + expect(within).to.be.a("function"); |
| 74 | +}); |
| 75 | + |
| 76 | +Scenario("dataTable should be importable", () => { |
| 77 | + expect(dataTable).to.exist; |
| 78 | +}); |
| 79 | + |
| 80 | +Scenario("dataTableArgument should be importable", () => { |
| 81 | + expect(dataTableArgument).to.exist; |
| 82 | +}); |
| 83 | + |
| 84 | +Scenario("store should be importable", () => { |
| 85 | + expect(store).to.exist; |
| 86 | + expect(store).to.be.an("object"); |
| 87 | + expect(store.debugMode).to.exist; |
| 88 | +}); |
| 89 | + |
| 90 | +Scenario("locator should be importable", () => { |
| 91 | + expect(locator).to.exist; |
| 92 | + expect(locator.build).to.be.a("function"); |
| 93 | +}); |
| 94 | + |
| 95 | +// Secret and secret are not exported from lib/index.js in older versions, so skip them |
| 96 | +// Scenario("Secret should be importable", () => { |
| 97 | +// expect(Secret).to.exist; |
| 98 | +// expect(Secret.secret).to.be.a("function"); |
| 99 | +// }); |
| 100 | + |
| 101 | +// Scenario("secret should be importable", () => { |
| 102 | +// expect(secret).to.exist; |
| 103 | +// expect(secret).to.be.a("function"); |
| 104 | +// |
| 105 | +// const mySecret = secret("my-password"); |
| 106 | +// expect(mySecret.toString()).to.equal("my-password"); |
| 107 | +// }); |
0 commit comments