@@ -125,81 +125,38 @@ jobs:
125
125
CONTAINER_APP_URL : ${{ env.CONTAINER_APP_URL }}
126
126
ARTIFACT_ID : ${{ env.ARTIFACT_ID }}
127
127
128
- # automated-ui-tests:
129
- # permissions:
130
- # actions: read
131
- # id-token: write # This is required for requesting the JWT
132
- # contents: read # This is required for actions/checkout
133
- # issues: write
134
- # runs-on: ubuntu-latest
135
- # environment: STAGE
136
- # steps:
137
- # - name: Checkout code
138
-
139
-
140
- # - name: Run UI acceptance tests
141
- # run: |
142
- # docker compose up -d --build webapp
143
- # echo -e "\033[0;32mdotnet restore RazorPagesMovie.UITests/RazorPagesMovie.UITests.csproj\033[0m"
144
- # dotnet restore RazorPagesMovie.UITests/RazorPagesMovie.UITests.csproj
145
-
146
- # echo -e "\033[0;32mWaiting for the web application to start...\033[0m"
147
- # sleep 20
148
-
149
- # echo -e "\033[0;32mdotnet test RazorPagesMovie.UITests/RazorPagesMovie.UITests.csproj --logger \"console;verbosity=detailed\"\033[0m"
150
- # dotnet test RazorPagesMovie.UITests/RazorPagesMovie.UITests.csproj --logger "console;verbosity=detailed"
151
- # env:
152
- # SA_PASSWORD: ${{ secrets.SA_PASSWORD }}
153
- # ConnectionStrings__RazorPagesMovieContext: ${{ secrets.CONNECTIONSTRINGS__RAZORPAGESMOVIECONTEXT }}
154
- # ASPNETCORE_URLS: ${{ secrets.ASPNETCORE_URLS }}
155
- # TAG: ${{ inputs.image_tag }}
156
- # ASPNETCORE_ENVIRONMENT: Development
157
-
158
128
automated-ui-tests :
159
- runs-on : ubuntu-latest
160
- steps :
161
- - name : Checkout code
162
- uses : actions/checkout@v4
163
-
164
- - name : Set up .NET
165
- uses : actions/setup-dotnet@v3
166
- with :
167
- dotnet-version : ' 6.0.x'
168
-
169
- - name : Build and Run Docker Compose
170
- run : |
171
- docker compose up -d --build webapp
172
- env :
173
- SA_PASSWORD : ${{ secrets.SA_PASSWORD }}
174
- ConnectionStrings__RazorPagesMovieContext : ${{ secrets.CONNECTIONSTRINGS__RAZORPAGESMOVIECONTEXT }}
175
- ASPNETCORE_URLS : http://0.0.0.0
176
- TAG : ${{ inputs.image_tag }}
177
-
178
- - name : List running Docker containers
179
- run : docker ps -a
180
-
181
- - name : Wait for application to be ready
182
- run : |
183
- echo "Waiting for app to be ready..."
184
- for i in {1..30}; do
185
- if curl -s http://localhost/ > /dev/null; then
186
- echo "App is up!"
187
- break
188
- fi
189
- sleep 5
190
- done
191
-
192
- - name : Verify application is accessible
193
- run : curl -v http://localhost
194
-
195
- - name : Run UI Tests
196
- run : |
197
- dotnet test RazorPagesMovie.UITests/RazorPagesMovie.UITests.csproj --logger "console;verbosity=detailed"
198
- env :
199
- ASPNETCORE_BASE_URL : http://localhost
200
- ASPNETCORE_ENVIRONMENT : Development
201
- ConnectionStrings__RazorPagesMovieContext : ${{ secrets.CONNECTIONSTRINGS__RAZORPAGESMOVIECONTEXT }}
202
-
129
+ permissions :
130
+ actions : read
131
+ id-token : write # This is required for requesting the JWT
132
+ contents : read # This is required for actions/checkout
133
+ issues : write
134
+ runs-on : ubuntu-latest
135
+ environment : STAGE
136
+ steps :
137
+ - name : Checkout code
138
+
139
+
140
+ - name : Set environment variables
141
+ run : |
142
+ export SA_PASSWORD='YourStrong!Passw0rd'
143
+ export ConnectionStrings__RazorPagesMovieContext='Server=sqlserver,1433;Database=RazorPagesMovieContext;User ID=sa;Password=YourStrong!Passw0rd;'
144
+ export ASPNETCORE_URLS="http://0.0.0.0:5000"
145
+ export TAG="132"
146
+
147
+ - name : Run Docker Compose
148
+ run : docker compose up -d --build webapp
149
+
150
+ - name : Run UI acceptance tests
151
+ run : |
152
+ echo -e "\033[0;32mdotnet clean RazorPagesMovie.UITests/RazorPagesMovie.UITests.csproj\033[0m"
153
+ dotnet restore RazorPagesMovie.UITests/RazorPagesMovie.UITests.csproj
154
+
155
+ echo -e "\033[0;32mWaiting for the web application to start...\033[0m"
156
+ sleep 20
157
+
158
+ echo -e "\033[0;32mdotnet test RazorPagesMovie.UITests/RazorPagesMovie.UITests.csproj --logger \"console;verbosity=detailed\"\033[0m"
159
+ dotnet test RazorPagesMovie.UITests/RazorPagesMovie.UITests.csproj --logger "console;verbosity=detailed"
203
160
204
161
production :
205
162
permissions :
0 commit comments