-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into trib-104
- Loading branch information
Showing
10 changed files
with
196 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# Detect the home directory | ||
home_dir=$(eval echo "~") | ||
|
||
# Source the common functions | ||
source $home_dir/src/bin/savv-shared-functions.sh | ||
|
||
# Check if an environment parameter is provided | ||
if [ $# -lt 1 ]; then | ||
echo "Error: No environment parameter provided." | ||
exit 1 | ||
fi | ||
|
||
# Environment parameter (dev, staging, prod) | ||
ENV_PARAM=$1 | ||
|
||
# Get the current project | ||
current_project=$(get_active_project) | ||
|
||
# Define the source and destination paths | ||
SOURCE_PATH="$home_dir/src/$current_project/src/app/_environments/environment.${ENV_PARAM}.ts" | ||
DESTINATION_PATH="$home_dir/src/$current_project/src/app/_environments/environment.ts" | ||
|
||
# Copy the environment file | ||
if [ -f "$SOURCE_PATH" ]; then | ||
cp "$SOURCE_PATH" "$DESTINATION_PATH" | ||
# echo "Environment file copied to $DESTINATION_PATH" | ||
else | ||
echo "Error: Source environment file $SOURCE_PATH does not exist." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,64 @@ | ||
it('Connect page should have accept new connection button', () => { | ||
describe('Connections Page', () => { | ||
Cypress.Commands.add('goToConnectionsPage', () => { | ||
cy.appLogin(); | ||
cy.get('[data-test="connect-menu-item"]').click(); | ||
}); | ||
|
||
cy.visit('http://localhost:8100/login') | ||
cy.get('[data-test="sign-in-btn"]').click() | ||
cy.get('[data-test="launchConnectPageButton"]').click() | ||
cy.get('[data-test="acceptNewConnectionBtn"]').click() | ||
cy.visit('http://localhost:8100/connect/accept-new-connection') | ||
it('navigate to connections page', () => { | ||
cy.goToConnectionsPage(); | ||
}); | ||
|
||
it('should display connections page', () => { | ||
cy.goToConnectionsPage(); | ||
cy.get('.listbtn').should('have.length', 1); | ||
cy.get('.openbtn').should('have.length', 1); | ||
cy.get('.acceptbtn').should('have.length', 1); | ||
}); | ||
|
||
describe('List Connections Page', () => { | ||
Cypress.Commands.add('goTolistConnectionPage', () => { | ||
cy.goToConnectionsPage(); | ||
|
||
// get a component with the class "listbtn" and click it | ||
cy.get('.listbtn').click(); | ||
}); | ||
|
||
const userId = '12345'; | ||
|
||
it('should display list connections page', () => { | ||
cy.intercept('GET', 'api/connect/' + userId + '/all', (req) => { | ||
req.reply({ | ||
statusCode: 200, | ||
body: [{ | ||
to: { | ||
userId: '344', | ||
username: 'testuser1' | ||
} | ||
}, | ||
{ | ||
to: { | ||
userId: '345', | ||
username: 'testuser2', | ||
} | ||
}, { | ||
to: { | ||
userId: '346', | ||
username: 'testuser3', | ||
} | ||
}] | ||
}); | ||
}).as('getAllConnections'); | ||
|
||
cy.goTolistConnectionPage(); | ||
cy.get('[data-test="connectionListItem"]').should('have.length', 3); | ||
}); | ||
}); | ||
|
||
describe('Accept New Connection Page', () => { | ||
|
||
}); | ||
|
||
describe('Open Connection Page', () => { | ||
|
||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,32 @@ | |
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element> | ||
// } | ||
// } | ||
// } | ||
// } | ||
|
||
Cypress.Commands.add('appLogin', () => { | ||
cy.intercept('POST', 'http://localhost:8080/api/public/login', (req) => { | ||
req.reply({ | ||
statusCode: 200, | ||
headers: { | ||
"Authorization": "Bearer ey", | ||
}, | ||
body: { | ||
"id": 12345, | ||
"name": "testuser", | ||
"password": "$2a$10$wGcNuV0Kodg7uz6qI/l/1uz1mMcpmAGZqfuZ3JxY9cAeejtYXUbWC", | ||
"phone": "3035551213", | ||
"email": "[email protected]", | ||
"enabled": 1, | ||
"roles": [{"id": 2, "name": "ROLE_accountholder"}], | ||
"created": 1724528143000, | ||
"lastUpdated": 1724528143000 | ||
} | ||
}); | ||
}).as('login'); | ||
|
||
cy.visit('http://localhost:8100/login') | ||
cy.get('[data-test="sign-in-btn"]').click() | ||
|
||
cy.wait('@login'); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters