Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

test: [ui-automation] WACI Share #1139

Merged
merged 1 commit into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ jobs:
make automation-test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v2
if: always()
with:
name: logs
path: test/fixtures/wallet-web/docker-compose.log

Publish:
name: Publish image
Expand Down
5 changes: 4 additions & 1 deletion scripts/run_ui_automation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ cd $ROOT/test/ui-automation
npm run test && npm run report
if [ $? -ne 0 ]
then
exit 1
cd $ROOT/test/fixtures/wallet-web
docker-compose -f docker-compose-demo.yml -f docker-compose-server.yml -f docker-compose-web.yml logs --no-color >& docker-compose.log

exit 1
fi

echo "stopping containers..."
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wallet-web/docker-compose-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
- TLS_CACERTS=/etc/tls/ec-cacert.pem
- TLS_KEY_FILE=/etc/tls/ec-key.pem
- TLS_CERT_FILE=/etc/tls/ec-pubCert.pem
- RESOLVER_URL=http://uni-resolver-web.trustbloc.local:9080
- ORB_DOMAIN=testnet.orb.local
ports:
- 8094:8094
- 8095:8095
Expand Down
18 changes: 8 additions & 10 deletions test/mock/adapter/didcomm.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import (
"net/http"
"os"

"github.com/hyperledger/aries-framework-go-ext/component/vdr/orb"
"github.com/hyperledger/aries-framework-go/component/storageutil/mem"
"github.com/hyperledger/aries-framework-go/pkg/client/didexchange"
"github.com/hyperledger/aries-framework-go/pkg/client/outofband"
"github.com/hyperledger/aries-framework-go/pkg/client/presentproof"
arieshttp "github.com/hyperledger/aries-framework-go/pkg/didcomm/transport/http"
"github.com/hyperledger/aries-framework-go/pkg/framework/aries"
"github.com/hyperledger/aries-framework-go/pkg/framework/aries/defaults"
"github.com/hyperledger/aries-framework-go/pkg/vdr/httpbinding"
)

type didComm struct {
Expand Down Expand Up @@ -49,13 +49,15 @@ func startAriesAgent() (*didComm, error) {

opts = append(opts, aries.WithOutboundTransports(outbound))

universalResolverVDRI, resErr := httpbinding.New(os.Getenv(resolverURL),
httpbinding.WithAccept(acceptsDID), httpbinding.WithTLSConfig(tlsConfig))
if resErr != nil {
return nil, fmt.Errorf("failed to create new universal resolver vdri: %w", resErr)
vdri, err := orb.New(nil,
orb.WithTLSConfig(tlsConfig),
orb.WithDomain(os.Getenv(orbDomainEnvKey)),
)
if err != nil {
return nil, fmt.Errorf("failed to init orb VDR: %w", err)
}

opts = append(opts, aries.WithVDR(universalResolverVDRI))
opts = append(opts, aries.WithVDR(vdri))

framework, err := aries.New(opts...)
if err != nil {
Expand Down Expand Up @@ -91,7 +93,3 @@ func startAriesAgent() (*didComm, error) {
PresentProofClient: presentProofClient,
}, nil
}

func acceptsDID(method string) bool {
return method == "orb"
}
3 changes: 2 additions & 1 deletion test/mock/adapter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ go 1.16

require (
github.com/google/uuid v1.2.0
github.com/gorilla/mux v1.7.3
github.com/gorilla/mux v1.8.0
github.com/hyperledger/aries-framework-go v0.1.8-0.20210916154931-0196c3a2d102
github.com/hyperledger/aries-framework-go-ext/component/vdr/orb v0.0.0-20210816155124-45ab1ecd4762
github.com/hyperledger/aries-framework-go/component/storageutil v0.0.0-20210916154931-0196c3a2d102
github.com/hyperledger/aries-framework-go/spi v0.0.0-20210916154931-0196c3a2d102
github.com/trustbloc/edge-core v0.1.7
Expand Down
642 changes: 630 additions & 12 deletions test/mock/adapter/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/mock/adapter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
tlsKeyFileEnvKey = "TLS_KEY_FILE"
tlsCertFileEnvKey = "TLS_CERT_FILE"
tlsCACertsEnvKey = "TLS_CACERTS"
resolverURL = "RESOLVER_URL"
orbDomainEnvKey = "testnet.orb.local"
)

func main() {
Expand Down
11 changes: 6 additions & 5 deletions test/mock/adapter/templates/verifier.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ <h2>WACI Share Demo</h2>
value="https://wallet.trustbloc.local:8091"
size="50"
/>
<br />
<input type="submit" value="Demo" />

<br />
<br />

{{.Msg}}
<input type="submit" id="waci-share-demo" value="Demo" />
</form>

<br />
<br />

<b>{{.Msg}} </b>
</body>
</html>
7 changes: 5 additions & 2 deletions test/mock/adapter/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,29 @@ import (
"github.com/hyperledger/aries-framework-go/component/storageutil/mem"
"github.com/hyperledger/aries-framework-go/pkg/client/didexchange"
"github.com/hyperledger/aries-framework-go/pkg/client/presentproof"
"github.com/hyperledger/aries-framework-go/pkg/common/log"
"github.com/hyperledger/aries-framework-go/pkg/didcomm/common/service"
"github.com/hyperledger/aries-framework-go/pkg/didcomm/protocol/decorator"
presentproofsvc "github.com/hyperledger/aries-framework-go/pkg/didcomm/protocol/presentproof"
"github.com/hyperledger/aries-framework-go/pkg/doc/presexch"
arieslog "github.com/hyperledger/aries-framework-go/spi/log"
"github.com/hyperledger/aries-framework-go/spi/storage"
"github.com/trustbloc/edge-core/pkg/log"
)

const (
verifierHTML = "./templates/verifier.html"
)

var logger = log.New("edge-adapter/rp-operations")
var logger = log.New("mock-adapter")

type verifierApp struct {
agent *didComm
store storage.Store
}

func startVerifierApp(agent *didComm, router *mux.Router) error {
log.SetLevel("", arieslog.DEBUG)

prov := mem.NewProvider()

store, err := prov.OpenStore("verifier")
Expand Down
58 changes: 35 additions & 23 deletions test/ui-automation/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/ui-automation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@wdio/cli": "^7.5.0",
"@wdio/selenium-standalone-service": "^7.5.0",
"chai": "^4.3.4",
"chromedriver": "^92.0.1",
"chromedriver": "^93.0.1",
"uuid-random": "^1.3.2",
"wdio-chromedriver-service": "^7.2.0",
"wdio-video-reporter": "^3.1.2"
Expand Down
Loading