Skip to content

GA Test Plan

Wassim Chegham edited this page May 11, 2022 · 19 revisions

Before running each test plan, install the latest source code from the GA branch:

  1. git clone -b ga http://github.com/Azure/static-web-apps-cli.git
  2. cd static-web-apps-cli
  3. npm install
  4. npm run build
  5. npm test
  6. npm run e2e:static
  7. npm link
  8. make sure there are no issues during npm install
  9. make sure there are no issues during npm run build
  10. make sure there are no issues during npm test

Framework tests

Click here for the list of tested frameworks.

swa

TODO

swa init

TODO

swa login

Test plan:

  1. login using keychain: node ./dist/cli/bin.js login --use-keychain
    • you might be asked to enter your system password.
    • the browser window will open
    • login with your Azure account
  2. login without keychain: node ./dist/cli/bin.js login --no-use-keychain
    • the browser window will open
    • login with your Azure account
  3. make sure the file ​.env ​has been created with the right project credentials
    AZURE_SUBSCRIPTION_ID=00000000-0000-0000-0000-000000000000
    AZURE_TENANT_ID=00000000-0000-0000-0000-000000000000
    
  4. make sure the .gitignore file got updated with the .env entry.
    • only applicable if you are in a git project.
  5. run node ./dist/cli/bin.js login --no-use-keychain again, the .env file will be used (no prompts)
  6. run node ./dist/cli/bin.js login --use-keychain true again, the .env file will be used (no prompts)
  7. try a different combination of flags (see swa login -h)

swa start

TODO

With a configuration file:

  1. swa start should start the default config
  2. swa start name should:
  3. start a config called name if found
  4. start an outputLocation called name if no config found 1. should print a warning message that we are using outputLocation instead of a config

swa build

TODO

swa deploy

Test plan for supported scenarios when deploying:

  1. the user should be authenticated

    1. if a user is logged out, they should be able to login in during deployment if they are not
    2. if the user is already logged in, they should process to deployment without being prompted
    3. if the Azure tenant is not selected, the user should be able to select one during the deployment
    4. if only one Azure tenant is available, it will be automatically selected without prompting the user
    5. if no Azure tenant is found, the deployment process is stopped.
    6. if an Azure subscription is not selected, the user should be able to select one during the deployment
    7. if only one Azure subscription is available, it will be automatically selected without prompting the user
    8. if no Azure subscription is found, the deployment process is stopped.
  2. the user should select a valid project

    1. if no project details were found, the user should be able to select a project
    2. if multiple projects are found, list all projects in the format resource-group/swa
    3. if no project was found, prompt the user to create a new project
    4. if the user provides appName, use it as a default name
    5. if the user provides does not provide an appName, use the current folder name as a default appName
    6. if the user has a set configurations.ID.deploy.appName in the swa-cli.config.json file, use it as a default appName
    7. if multiple projects are found:
    8. if the project is available, show a list of projects and highlight that project
    9. if the project is NOT available, show a list of projects and highlight the CREATE option
    10. if one project is found:
    11. the project is available, automatically select that project without prompting the user
    12. the project is NOT available, prompt the user to create a new project using the provided name
    13. when creating a project, if the project already exists, prompt the user to override the existing project
    14. on success, the user should be able to see the URL of the deployed project
    15. users should access their custom domain (if it's set)
  3. the --yes mode (will be added later. Cc @sinedied )

    1. if the user provides appName, use it as a default name
    2. if the user provides does not provide an appName, use the current folder name as an appName
    3. do not prompt the user for any questions (assume yes to all prompts) and use these defaults:
    4. if no project is found, automatically create a new one using appName
    5. if one project is found 1. if it matched appName, use it 1. if it doesn't match appName, create a new project using appName
    6. if multiple projects were found 1. if appName is in the list, use it 1. if appName is NOT in the list, create a new project using appName
  4. the --dry-run mode

    1. skip the whole deployment process
    2. ignore the missing deployment token error message (that's expected until StaticSitesClient implements a dry-run mode)
  5. error handling

    1. the deployment should exit on any error
    2. if the user press CTRL+C during any step, the deployment should exit.
    3. if the selected project is already linked to a different provider, error, and exit.
    4. if the users reach the quota in the default Azure region, they should be able to override the default location using AZURE_REGION_LOCATION="azure-region"
  6. other

    1. deployment token should NOT be stored in swa-cli.config.json file
Clone this wiki locally